import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long N = lread();
    long[string] cnt;
    foreach (_; 0 .. N)
    {
        auto s = sread();
        cnt[s] = cnt.get(s, 0) + 1;
    }
    auto K = cnt.keys;
    auto V = K.map!((k) => cnt[k]).array;

    zip(V, K).sort!(less)();
    foreach (i; 0 .. V.length)
    {
        if (V[i] != V[0])
            return;
        writeln(K[i]);
    }
}

bool less(Tuple!(long, string) a, Tuple!(long, string) b)
{
    if (a[0] == b[0])
        return a[1] < b[1];
    return b[0] < a[0];
}
