#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const long double pi = acos(-1);
const long double eps = 1e-7;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
int a[110][110];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = (1); i <= (m); i++) {
    for (int j = (1); j <= (n); j++) {
      cin >> a[j][i];
    }
  }
  int ans = m;
  vector<int> s;
  for (int i = (1); i <= (m); i++) s.emplace_back(i);
  for (int i = (1); i <= (n - 1); i++) {
    priority_queue<pair<int, int> > q;
    int sum = 0;
    int sumt = 0;
    for (int j = (1); j <= (m); j++) {
      q.emplace(a[n][j] - a[i][j], j);
      sum += a[n][j];
      sumt += a[i][j];
    }
    int t = sum - sumt;
    int res = 0;
    vector<int> tt;
    while (!q.empty() && t > 0) {
      t -= q.top().first;
      tt.emplace_back(q.top().second);
      q.pop();
      res++;
    }
    if (res < ans) {
      s = tt;
      ans = res;
    }
  }
  cout << ans << '\n';
  for (auto it : s) cout << it << " ";
}
