/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>
// #include <math.h>
#include <map>
#include <algorithm>

namespace AtCoder {
	using Str = std::vector<std::string>;
	using Num = std::vector<int>;
	using BigNum = std::vector<double>;

	class InputData {
	public:
		void getInput(void);
		void skipInput(void);
		Str getStr(void);
		Num getNum(void);
		BigNum getBigNum(void);
	private:
		Str str;
		Num num;
		BigNum bNum;
	};
	Str AtCoder::InputData::getStr(void) {
		return this->str;
	}
	Num AtCoder::InputData::getNum(void) {
		return this->num;
	}
	BigNum AtCoder::InputData::getBigNum(void) {
		return this->bNum;
	}
	void AtCoder::InputData::skipInput(void) {
		std::string buf = "";
		std::getline(std::cin, buf);
	}
	void AtCoder::InputData::getInput(void) {
		this->str.clear();
		this->num.clear();
		this->bNum.clear();

		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				this->str.push_back(row);
				this->num.push_back(std::atoi(row.c_str()));
				this->bNum.push_back(std::atof(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		this->str.push_back(row);
		this->num.push_back(std::atoi(row.c_str()));
		this->bNum.push_back(std::atof(row.c_str()));
	}

	class Ans {
	public:
		void showResult(void);
		void increment(void);
		void increment(double);
		void decrement(void);
		void decrement(double);
		double getResult(void);
	private:
		double result;
	};
	void Ans::showResult(void) {
		printf("%.0lf\n", this->result);
	}
	void AtCoder::Ans::increment(void) {
		this->result++;
	}
	void AtCoder::Ans::increment(double value) {
		this->result += value;
	}
	void AtCoder::Ans::decrement(void) {
		this->result--;
	}
	void AtCoder::Ans::decrement(double value) {
		this->result -= value;
	}
	double AtCoder::Ans::getResult(void) {
		return this->result;
	}

	void exp(std::string* str,  Str* newStr) {
		std::string pre = *str;
		newStr->clear();
		for (unsigned int i = 0; i < pre.length(); i++) {
			newStr->push_back(pre.substr(i, 1));
		}
	}
	using DefMap = std::map<std::string, int>;

	class Map {
	public:
		void set(std::string, int);
		int get(std::string);
		void remove(std::string);
	private:
		DefMap m;
	};
	void Map::set(std::string key, int value) {
		try {
			this->m.at(key);
			this->remove(key);
			this->m.insert(std::make_pair(key, value));
		} catch (std::exception & e) {
			this->m.insert(std::make_pair(key, value));
		}
	}
	int Map::get(std::string key) {
		try {
			return this->m.at(key);
		} catch (std::exception & e) {
			return 0;
		}
	}
	void Map::remove(std::string key) {
		this->m.erase(key);
	}
	void unique(std::vector<std::string>* vec) {
		std::sort(vec->begin(), vec->end());
		vec->erase(std::unique(vec->begin(), vec->end()), vec->end());
	}
}

int main(void) {

	AtCoder::InputData* data = new AtCoder::InputData();
	data->getInput();

	const int max = data->getNum()[0];

	AtCoder::Map* map = new AtCoder::Map();
	AtCoder::Str buf;
	int mapmax = 0;
	for (int i = 0; i < max; i++) {
		data->getInput();
		AtCoder::Str str = data->getStr();
		map->set(str[0], (map->get(str[0]) + 1));
		if (mapmax < map->get(str[0])) {
			mapmax = map->get(str[0]);
		}
		buf.push_back(str[0]);
	}

	AtCoder::unique(&buf);

	for (std::string s : buf) {
		if (mapmax == map->get(s)) {
			printf("%s\n", s.c_str());
		}
	}

	delete(data);

	return 0;
}

Measured memory_bytes: 23084