#include <iostream>
#include <map>

int main()
{
    using namespace std;

    multimap<int, bool> ranges;

    for (int start, end; cin >> start && cin >> end;)
    {
        ranges.emplace(start, true);
        ranges.emplace(end, false);
    }

    int start, end, max = 0, current = 0;
    bool closing = false;

    for (auto value : ranges)
    {
        current += value.second ? 1 : -1;

        if (current > max)
        {
            start = value.first;
            max = current;
            closing = true;
        }

        if (closing && !value.second)
        {
            closing = false;
            end = value.first;
        }
    }

    cout << max << " (" << start << " -> " << end << ")\n";
}