#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  string s;
  map<int, int> mp;
  set<int> st;
  int mx = 0;
  while (getline(cin, s)) {
    int a = stoi(s);
    mp[a]++;
    if (mp[a] == mx) {
      st.insert(a);
    } else if (mp[a] > mx) {
      mx = mp[a];
      set<int>().swap(st);
      st.insert(a);
    }
  }
  for (int e : st) {
    cout << e << '\n';
  }
}
