#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 10;
const int MAXN = 1e6 + 10;
double PI = 3.1415926535898;
int a[105][105];
int ans1[105];
int main() {
  int n, m, ans = INF;
  cin >> n >> m;
  for (int i = 0; i < m; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  for (int i = 1; i < n; i++) {
    vector<pair<int, int> > vec;
    for (int j = 0; j < m; j++) {
      vec.push_back(make_pair(a[j][n] - a[j][i], j));
    }
    sort(vec.begin(), vec.end());
    int x = 0, y = 0;
    while (y < vec.size()) {
      if (x + vec[y].first <= 0) {
        x += vec[y].first;
        y++;
      } else
        break;
    }
    if (vec.size() - y < ans) {
      ans = vec.size() - y;
      memset(ans1, 0, sizeof(ans1));
      for (int j = 0; j < y; j++) {
        ans1[vec[j].second] = 1;
      }
    }
  }
  cout << ans << endl;
  n = 0;
  for (int i = 0; i < m; i++) {
    if (!ans1[i]) {
      if (n) cout << ' ';
      cout << i + 1;
    }
    n = 1;
  }
  cout << endl;
}
