#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int count[a];
  int maxCandidate = 0;
  memset(count, 0, sizeof(count));
  for (int i = 0; i < b; i++) {
    int nums[a];
    int max = 0;
    for (int j = 0; j < a; j++) {
      cin >> nums[j];
      if (nums[j] > max) {
        max = nums[j];
      }
    }
    int index = 0;
    bool not_found = true;
    for (int k = 0; k < a; k++) {
      if (not_found && nums[k] == max) {
        index = k;
        not_found = false;
      }
    }
    count[index]++;
    if (count[index] > maxCandidate) {
      maxCandidate = count[index];
    }
  }
  int index = 0;
  bool not_found = true;
  for (int k = 0; k < a; k++) {
    if (not_found && count[k] == maxCandidate) {
      index = k;
      not_found = false;
    }
  }
  cout << index + 1;
}
