import core.bitop, std.bitmanip;
import core.checkedint;
import std.algorithm, std.functional, std.meta;
import std.array, std.container;
import std.bigint;
import std.conv;
import std.math, std.numeric;
import std.range, std.range.interfaces;
import std.stdio, std.string;
import std.typecons;

void main()
{
    int n;
    readf("%s", &n);
    readln;
    
    int[string] cnt;
    foreach (_; 0 .. n) {
        auto s = readln.chomp;
        
        cnt[s] += 1;
    }
    
    string[] ans;
    int mx = cnt.values.sort().back;
    foreach (s; cnt.keys) {
        if (cnt[s] == mx) {
            ans ~= s;
        }
    }
    
    ans.sort();
    
    ans.each!writeln;
}