#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long mod1 = 1e9 + 7;
const int N = 2e2 + 10;
int n, m;
int a[N][N];
vector<int> ans1, ans;
int check(int x) {
  ans.clear();
  int m1 = 0;
  vector<pair<long long, long long> > v;
  for (int i = 0; i < n; i++) v.push_back(make_pair(-a[i][x] + a[i][m - 1], i));
  sort(v.begin(), v.end());
  int i = 0;
  while (i < n && v[i].first + m1 <= 0) m1 += v[i].first, i++;
  for (int j = i; j < n; j++) ans.push_back(v[j].second);
  return ans.size();
}
void solve() {
  cin >> m >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  int x = 1e9;
  for (int i = 0; i < m - 1; i++) {
    int y = check(i);
    if (y < x) x = y, ans1 = ans;
  }
  sort(ans1.begin(), ans1.end());
  cout << x << "\n";
  for (int i = 0; i < ans1.size(); i++) cout << ans1[i] + 1 << " ";
}
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
