#include <iostream>
using namespace std;

#define SAFE_DELETE( x ) { if ( x ){ delete x; x = NULL; } }

struct tCell{
	tCell() : number( 0 ), count( 0 ), prev( NULL ), next( NULL ){}

	int number, count;
	tCell *prev, *next;
};

class Database{
public:
	Database() : size( 0 ), head( NULL ), tail( NULL ){
		head = new tCell;
		tail = new tCell;
		head->next = tail;
		tail->prev = head;
	}
	~Database(){
		init();
		SAFE_DELETE( tail );
		SAFE_DELETE( head );
	}

	void init(){
		for ( int i = size; i > 0; --i ){
			tCell* cell = tail->prev;
			cell->prev->next = cell->next;
			cell->next->prev = cell->prev;
			SAFE_DELETE( cell );
		}
	}
	void store( int n ){
		bool stored = false;
		tCell* cell = head;
		for ( int i = 0; i < size; ++i ){
			cell = cell->next;
			if ( cell->number == n ){
				++cell->count;
				stored = true;
				break;
			}
		}
		if ( !stored ){
			pushBack( n );
		}
	}
	void sort(){
		for ( int i = 0; i < size - 1; ++i ){
			tCell* cell = head;
			tCell* celln = head->next;
			for ( int j = 0; j < size - 1 - i; ++j ){
				cell = celln;
				celln = celln->next;
				if ( cell->number > celln->number ){
					int tn = cell->number;
					int tc = cell->count;
					cell->number = celln->number;
					cell->count = celln->count;
					celln->number = tn;
					celln->count = tc;
				}
			}
		}
	}
	void maxCount( Database& db ){
		int c = 0;
		tCell* cell = head;
		for ( int i = 0; i < size; ++i ){
			cell = cell->next;
			if ( c < cell->count ) c = cell->count;
		}
		db.init();
		cell = head;
		for ( int i = 0; i < size; ++i ){
			cell = cell->next;
			if ( cell->count == c ){
				db.store( cell->number );
			}
		}
	}
	int getSize(){ return size; }
	
	tCell operator[]( int n ){
		tCell* cell = head->next;
		if ( n >= size ){ cell = NULL; return *cell; }
		for ( int i = 0; i < n; ++i ){
			cell = cell->next;
		}
		return *cell;
	}

private:
	void pushBack( int n ){
		++size;
		tCell* cell = new tCell;
		cell->number = n;
		++cell->count;
		cell->prev = tail->prev;
		cell->next = tail;
		cell->prev->next = cell;
		cell->next->prev = cell;
	}

	int size;
	tCell *head, *tail;
};

int main(){
	int n;
	Database db, result;

	while ( cin >> n ){
		db.store( n );
	}

	db.sort();
	db.maxCount( result );
	for ( int i = 0; i < result.getSize(); ++i ){
		cout << result[ i ].number << endl;
	}

	return 0;
}