#include <iostream>
#include <cmath>

int divisorsSum( int x )
{
    int result = 1;
    
    for ( int d = 2; d*d <= x; ++d )
    {
        if ( x % d == 0 )
        {
            result += d + x/d;
        }
    }

    return result;
}

void findNFriends( int n )
{
    int findedCount = 0;
    for ( int f = 0; ; ++f )
    {
        int s = divisorsSum( f );
        if ( (f < s) && (f == divisorsSum( s )))
        {
            ++findedCount;
            std::cout << findedCount << ": (" << f << ", " << s << ")" << std::endl;
            
            if ( findedCount >= n ) break;
        }
    }
}

int main() {
    findNFriends(26);
    return 0;
}