#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn][maxn];
int ind[maxn];
int i, j, m, n;
int main() {
  cin >> m >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
      a[n][j] += a[i][j];
    }
  }
  int mx = a[n][m - 1];
  for (i = 0; i < m - 1; i++) {
    if (a[n][i] >= mx) {
      cout << 0;
      return 0;
    }
  }
  int minCount = n;
  int minElement = -1;
  for (j = 0; j < m - 1; j++) {
    for (i = 0; i < n; i++) ind[i] = i;
    sort(ind, ind + n, [](int i1, int i2) {
      return a[i1][j] - a[i1][m - 1] < a[i2][j] - a[i2][m - 1];
    });
    int s1 = a[n][m - 1];
    int s2 = a[n][j];
    for (int i = 0; i < n; i++) {
      s1 -= a[ind[i]][m - 1];
      s2 -= a[ind[i]][j];
      if (s2 >= s1) {
        if (i + 1 < minCount) {
          minCount = i + 1;
          minElement = j;
        }
        break;
      }
    }
  }
  if (minCount == n) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << i + 1 << " ";
    }
    return 0;
  }
  cout << minCount << endl;
  j = minElement;
  for (i = 0; i < n; i++) ind[i] = i;
  sort(ind, ind + n, [](int i1, int i2) {
    return a[i1][j] - a[i1][m - 1] < a[i2][j] - a[i2][m - 1];
  });
  for (int i = 0; i < minCount; i++) {
    cout << ind[i] + 1 << " ";
  }
}
