import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args) {
ArrayList<Apple> arr = new ArrayList<>();
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int temp = 0, appleBad = 0, appleAll = 0, num;
for (int i = 0; i < N; i++) {
appleBad = 0;
num = sc.nextInt();
for (int j = 0; j < M; j++) {
temp = sc.nextInt();
appleBad = temp + appleBad;
}
appleAll = (num + appleBad) + appleAll;
arr.add(new Apple(i + 1, appleBad));
}
Collections.sort(arr);
System.out.println(appleAll + " " + arr.get(0).index + " " + -arr.get(0).applesBad);
}
}
class Apple implements Comparable {
int index;
int applesBad;
Apple(int index, int applesBad) {
this.index = index;
this.applesBad = applesBad;
}
@Override
public int compareTo(Object o) {
if (o instanceof Apple) {
Apple obj = (Apple) o;
if (this.applesBad > obj.applesBad)
return 1;
else if (this.applesBad < obj.applesBad)
return -1;
else
return 0;
} else
return 0;
}
}