#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, brne=0, brnene=0, brda=0, brdane=0, kushta=0, pchk, pnek;
cin>>n;
int n2=n;
for(int br=0;br<n2;cin>>kushta){
    while(kushta%2!=0){
    brne++;
    pnek=kushta;
    }
    if(kushta%2==0){
        brnene=(pnek-1)/2+1-brne;
        br=0;
        brda=1;
        n=n-brne;
    }
    while(br==n){
        brda++;
        if(br==n){
        brdane=(kushta-2)/2+1-brda;
        cout<<brdane<<" "<<brnene;
        return 0;
    }
    }
    br++;
}

return 0;
}