#include <bits/stdc++.h>
using namespace std;
const int maxn = 150;
int a[maxn][maxn];
struct node {
  int v, id;
  bool operator<(const node &c) const {
    if (v == c.v) return id < c.id;
    return v < c.v;
  }
} b[maxn];
vector<int> ve;
int main() {
  int n, m;
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
    }
    ve.push_back(i);
  }
  int ans = n;
  for (int j = 1; j < m; j++) {
    for (int i = 1; i <= n; i++) {
      b[i].v = a[i][j] - a[i][m];
      b[i].id = i;
    }
    sort(b + 1, b + 1 + n);
    int tmp = 0;
    for (int i = n; i >= 1; i--) {
      tmp += b[i].v;
      if (tmp < 0) {
        if (ans > i) {
          ans = i;
          ve.clear();
          for (int jj = 1; jj <= i; jj++) {
            ve.push_back(b[jj].id);
          }
        }
        break;
      }
    }
    if (tmp >= 0) {
      ans = 0;
      ve.clear();
      break;
    }
  }
  printf("%d\n", ans);
  for (auto it : ve) printf("%d ", it);
  printf("\n");
}
