import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
HashMap<Integer,Integer>hashMap=new HashMap<>();
int m=scanner.nextInt();
int n=scanner.nextInt();
for (int i=0;i<n;i++){
for (int j=0;j<m;j++){
int key=scanner.nextInt();
if (!hashMap.containsKey(key)){
hashMap.put(key,1);
}
else {
hashMap.put(key,hashMap.get(key)+1);
}
}
}
for(Map.Entry<Integer,Integer>entry:hashMap.entrySet()){
if (entry.getValue()>m*n/2){
System.out.println(entry.getKey());
}
}
}
}