#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXSTAT = 100;
const int MAXCAND = 100;
int ncand, nstat;
int votes[MAXSTAT][MAXCAND];
vector<int> ans;
void solve() {
  ans = vector<int>(nstat);
  for (int i = (0); i < (nstat); ++i) ans[i] = i;
  for (int me = (0); me < (ncand - 1); ++me) {
    int opp = ncand - 1;
    vector<bool> keep(nstat, false);
    int bal = 0;
    vector<pair<int, int>> opt;
    for (int i = (0); i < (nstat); ++i) {
      int delta = votes[i][me] - votes[i][opp];
      if (delta >= 0) {
        keep[i] = true;
        bal += delta;
      } else {
        opt.push_back(make_pair(-delta, i));
      }
    }
    sort(opt.begin(), opt.end());
    for (int i = (0); i < (((int)(opt).size())); ++i)
      if (bal >= opt[i].first) bal -= opt[i].first, keep[opt[i].second] = true;
    vector<int> cur;
    for (int i = (0); i < (nstat); ++i)
      if (!keep[i]) cur.push_back(i);
    if (((int)(cur).size()) < ((int)(ans).size())) ans = cur;
  }
}
void run() {
  scanf("%d%d", &ncand, &nstat);
  for (int i = (0); i < (nstat); ++i)
    for (int j = (0); j < (ncand); ++j) scanf("%d", &votes[i][j]);
  solve();
  printf("%d\n", ((int)(ans).size()));
  for (int i = (0); i < (((int)(ans).size())); ++i) {
    if (i != 0) printf(" ");
    printf("%d", ans[i] + 1);
  }
  puts("");
}
int main() {
  run();
  return 0;
}
