import std.stdio;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;

void main()
{
    auto N = readln.chomp.to!long;
    auto as = readln.chomp.split.to!(long[]);

    as = as.sort().array;

    long max;
    long mn;
    long mr;

    foreach (i, n; as)
        foreach (r; as[0 .. i])
        {
            assert(r < n);
            auto tmp = comb(n, r);
            if (max < tmp)
            {
                max = tmp;
                mn = n;
                mr = r;
            }
        }
    writeln(mn, " ", mr);
}

long comb(long n, long r)
{
    if (r == 0 || r == n)
        return 1;
    else if (r == 1)
        return n;
    return (memoize!comb(n - 1, r - 1) + memoize!comb(n - 1, r));
}
