#include <bits/stdc++.h>
using namespace std;
int tab[10001];
int main() {
int n, max=-1, odp;
while(cin >> n) tab[n]++;
for(int i=0;i<=10000;i++) {
if(tab[i]>max) {
max=tab[i];
odp=i;
}
}
cout << odp;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgdGFiWzEwMDAxXTsKCmludCBtYWluKCkgewoJCglpbnQgbiwgbWF4PS0xLCBvZHA7Cgl3aGlsZShjaW4gPj4gbikgdGFiW25dKys7Cglmb3IoaW50IGk9MDtpPD0xMDAwMDtpKyspIHsKCQlpZih0YWJbaV0+bWF4KSB7CgkJCW1heD10YWJbaV07CgkJCW9kcD1pOwoJCX0KCX0KCWNvdXQgPDwgb2RwOwoKCXJldHVybiAwOwp9