#include <iostream>

using namespace std;

int main()
{
    long long n,sum=0;
    cin >> n;
    long long a[2*n];
    for (int i=0;i<2*n;i++){
        cin >>a[i];
        sum=sum+a[i];
    }
    sum=sum-n;
    if (sum >23){
        cout << 41 <<" " << 13;
    }
    else{
    cout << 23 << " " << 7;
    }
}
