import std.stdio, std.algorithm, std.string;

void main()
{
    readln();
    auto s = readln().strip();

    int[string] d;

    foreach (i; 0 .. s.length - 1)
    {
        d[s[i .. i+2]]++;
    }

    int maxCount = 0;
    string maxStr = "";

    foreach (str, count; d)
    {
        if (count > maxCount)
        {
            maxCount = count;
            maxStr = str;
        }
    }

    writeln(maxStr);
}