#include<iostream>
#include<algorithm>
using namespace std;
struct ss {
int num;
int sale=0;
};
bool cmp(struct ss a,struct ss b ) {
return a.sale==b.sale?a.num<b.num:a.sale>b.sale;
}
int main() {
int n,m;
cin>>n>>m;
struct ss ans[n];
for(int i=0; i<m; ++i)
for(int j=0; j<n; ++j) {
int t;
cin>>t;
ans[j].sale+=t;
ans[j].num=j+1;
}
sort(ans,ans+n,cmp);
cout<<ans[0].sale<<endl;
cout<<ans[0].num;
for(int i=1; i<n; ++i)
if(ans[i].sale==ans[0].sale)
cout<<" "<<ans[i].num;
return 0;
}