#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
long long mod = (long long)998244353;
int n, m;
int a[111][111], sum[111];
std::vector<pair<int, int>> pv[111];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    for (int j = 1; j <= n; ++j) {
      cin >> a[i][j];
      sum[j] += a[i][j];
    }
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = 1; j <= n - 1; ++j) {
      pv[j].push_back(make_pair(a[i][n] - a[i][j], i));
    }
  }
  vector<int> ans;
  for (int i = 1; i <= m; ++i) ans.push_back(i);
  for (int i = 1; i <= n - 1; ++i) {
    sort(pv[i].begin(), pv[i].end(), greater<pair<int, int>>());
    int os = sum[n];
    int ns = sum[i];
    int dif = os - ns;
    vector<int> tmp;
    for (int j = 0; j < pv[i].size(); ++j) {
      if (dif <= 0) break;
      dif -= pv[i][j].first;
      tmp.push_back(pv[i][j].second);
    }
    if (dif <= 0) {
      if (tmp.size() < ans.size()) {
        ans = tmp;
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
  }
  if (ans.size() == 0) {
    cout << endl;
  }
  return 0;
}
