#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main() {
	int num[100], max = 0, n;
	for (int w = 0; w < 100; w++) {
		num[w] = 0;
	}
	while (cin >> n) {
		if (n == 0)break;
		num[n - 1]++;
		if (num[n - 1] > max)max = num[n - 1];
	}
	for (int w = 0; w < 100; w++) {
		if (num[w] == max)cout << w + 1 << endl;
	}
	return 0;
}
