//简单粗暴,要你变好
#include <iostream>
#include <unordered_map>
using namespace std;
int main() {
int m, n;
scanf("%d %d", &m, &n);
unordered_map<int, int> arr;
int half = m * n / 2;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
int temp;
scanf("%d", &temp);
arr[temp]++;
if (arr[temp] > half) {
printf("%d", temp);
return 0;
}
}
}
return 0;
}