#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (!b) ? a : gcd(b, a % b);
}
int t = 1;
int ti;
const int N = 1e2 + 5;
int tot[N], vts[N][N];
int cmp(const pair<pair<int, int>, int> &a,
        const pair<pair<int, int>, int> &b) {
  return ((a.first.first - a.first.second) < (b.first.first - b.first.second));
}
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> vts[i][j];
      tot[j] += vts[i][j];
    }
  }
  int f = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (tot[i] >= tot[n]) {
      f = 1;
    }
  }
  if (f) {
    cout << 0;
    return;
  }
  int ans = 105;
  vector<int> fv;
  for (int i = 1; i <= n - 1; i++) {
    vector<pair<pair<int, int>, int> > dif;
    for (int j = 1; j <= m; j++) dif.push_back({{vts[j][i], vts[j][n]}, j});
    sort(dif.begin(), dif.end(), cmp);
    int a1 = tot[i], a2 = tot[n];
    vector<int> av;
    int k = 0;
    while (k < (int)dif.size()) {
      a1 -= dif[k].first.first;
      a2 -= dif[k].first.second;
      av.push_back(dif[k].second);
      if (a1 >= a2) {
        ans = min(ans, (int)av.size());
        if (ans == (int)av.size()) fv = av;
        break;
      }
      k++;
    }
  }
  cout << (int)fv.size() << '\n';
  for (auto x : fv) cout << x << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  for (ti = 1; ti <= t; ti++) solve();
}
