#include<iostream>
using namespace std;
int main() {
	int l[100] = { 0 };
	int n = 0;
	while (!cin.eof()){
		int g;
		cin >> g;
		g--;
		l[g]++;
		if (l[g] >= n) n = l[g];
		cout << n << endl;
	}
	for (int i = 0; i < 100; i++){
		if (l[i] == n) {
			cout << i + 1 << endl;
		}
	}
	char c;
	cin >> c;
}