#include <bits/stdc++.h>
const int maxx = 3e5;
const int mod = 10007;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
using namespace std;
int n, m, T, ans;
int a[105][105], cnt[105];
vector<int> v;
int main() {
  int i, j, k;
  while (scanf("%d %d", &n, &m) == 2) {
    for (i = 1; i <= m; i++) {
      for (j = 1; j <= n; j++) {
        scanf("%d", &a[i][j]);
        cnt[j] += a[i][j];
      }
    }
    ans = inf;
    for (i = 1; i < n; i++) {
      k = cnt[i] - cnt[n];
      vector<pair<int, int> > V;
      for (j = 1; j <= m; j++) V.push_back(make_pair(a[j][n] - a[j][i], j));
      vector<int> cur;
      sort(V.begin(), V.end());
      reverse(V.begin(), V.end());
      for (j = 0; j < V.size(); j++) {
        if (k >= 0) {
          if (j < ans) {
            ans = j;
            v = cur;
          }
        }
        cur.push_back(V[j].second);
        k += V[j].first;
      }
      if (k >= 0) {
        if (V.size() < ans) {
          ans = V.size();
          v = cur;
        }
      }
    }
    printf("%d\n", ans);
    for (i = 0; i < v.size(); i++) printf("%d ", v[i]);
    puts("");
  }
  return 0;
}
