#include <iostream>
using namespace std;
int main(){
int sum = 0;
int minv = 0, index;
int n, m; cin >> n >> m;
for(int i = 1; i <= n; i ++ ){
int t; cin >> t;
sum += t;
int down = 0;
for(int j = 1; j <= m; j ++ ){
cin >> t; down += t;
}
sum += down;
if(down < minv) minv = down, index = i;
}
cout << sum << ' ' << index << ' ' << -minv << endl;
return 0;
}