#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, m;
int a[N][N];
vector<int> ans[N];
struct node {
  int v, pos;
  bool operator<(const node& b) const { return v > b.v; }
};
vector<node> b[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i < n; i++) {
    for (int j = 1; j <= m; j++) {
      b[i].push_back({a[j][i] - a[j][n], j});
    }
    int sum[N] = {0};
    sort(b[i].begin(), b[i].end());
    for (int j = 1; j <= m; j++) {
      sum[j] = sum[j - 1] + b[i][j - 1].v;
    }
    int fl = 0;
    int id;
    for (int j = 1; j <= m; j++) {
      if (sum[j] < 0) {
        fl = 1;
        id = j;
        break;
      }
    }
    if (!fl) {
      cout << 0 << endl;
      return 0;
    }
    for (int j = id; j <= m; j++) {
      ans[i].push_back(b[i][j - 1].pos);
    }
  }
  int id = 1;
  int min = ans[1].size();
  for (int i = 1; i < n; i++) {
    if (ans[i].size() < min) {
      id = i;
      min = ans[i].size();
    }
  }
  cout << ans[id].size() << endl;
  for (auto x : ans[id]) cout << x << " ";
  cout << endl;
  return 0;
}
