#include <bits/stdc++.h>
using namespace std;
int numCandidate, numStation, polling[100 + 3][100 + 3];
vector<int> getCanceledStations(int candidate) {
  vector<pair<int, int> > canceledStationCandidates;
  int scoreDifference = 0;
  for (int i = 1; i <= numStation; i++) {
    int diff = polling[i][candidate] - polling[i][numCandidate];
    scoreDifference += diff;
    if (diff < 0) canceledStationCandidates.push_back(make_pair(diff, i));
  }
  sort(canceledStationCandidates.begin(), canceledStationCandidates.end());
  vector<int> canceledStations;
  int currentIndex = 0;
  while (scoreDifference < 0) {
    scoreDifference -= canceledStationCandidates[currentIndex].first;
    canceledStations.push_back(canceledStationCandidates[currentIndex].second);
    currentIndex += 1;
  }
  return canceledStations;
}
int main() {
  cin >> numCandidate >> numStation;
  for (int row = 1; row <= numStation; row++) {
    for (int column = 1; column <= numCandidate; column++)
      cin >> polling[row][column];
  }
  int bestCandidate = 1;
  int numberOfCanceledStations = getCanceledStations(bestCandidate).size();
  for (int candidate = 1; candidate <= numCandidate - 1; candidate++) {
    vector<int> canceledStations = getCanceledStations(candidate);
    if (canceledStations.size() < numberOfCanceledStations) {
      bestCandidate = candidate;
      numberOfCanceledStations = canceledStations.size();
    }
  }
  vector<int> canceled = getCanceledStations(bestCandidate);
  cout << canceled.size() << endl;
  for (int i = 0; i < canceled.size(); i++) {
    if (i > 0) cout << " ";
    cout << canceled[i];
  }
  cout << endl;
}
