/* AOJ0028 Mode Value */  
  
#include <iostream>  
#include <algorithm>  
#include <map>  
#include <vector>  
  
using namespace std;  
  
typedef pair<int, int> PAIR;  
  
bool cmp(const PAIR& left, const PAIR& right)  
{  
    return left.second == right.second ? left.first < right.first : left.second > right.second;  
}  
  
int main()  
{  
    map<int, int> m;  
    int a, max;  
  
    while(~scanf("%d", &a))  
        m[a]++;  
  
    // map中元素转存到vector中  
    vector<PAIR> v(m.begin(), m.end());  
  
    // vector排序  
    sort(v.begin(), v.end(), cmp);  
  
    max = v[0].second;  
    for (int i = 0; i != (int)v.size(); ++i)  
        if(v[i].second == max)  
            cout << v[i].first << endl;  
        else  
            break;  
  
    return 0;  
}  

//这是老师的程序，目前我写的话还是会有难度的 
