#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 1001;
int main(){
vector<int> apple(maxn, 0);
vector<int> drop(maxn, 0);
int n, m, temp;
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++){ //更新两个数组
scanf("%d", &apple[i]);
for (int j = 0; j < m; j++){
scanf("%d", &temp);
apple[i] += temp;
drop[i] += abs(temp);
}
}
long long sum = 0;
for (int i = 0; i < n; i++){
sum += apple[i];
}
int maxi = 0, max_drop = drop[0];
for (int i = 1; i < n; i++){
if (drop[i] > drop[maxi]){
maxi = i;
max_drop = drop[i];
}
}
printf ("%lld %d %d\n", sum, maxi + 1, max_drop);
return 0;
}