#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long nz[n];
    long long nzc[n - 1];
    long long nzn[n - 1];
    for (int i = 0;i < n;i++)
    {
        cin>>nz[i];
        if (nz[i] % 2 == 0)
        {
            nzc[i] = nz[i];
        }
        else nzn[i] = nz[i];
    }
    sort (nzn, nzn + n - 1);
    reverse (nzn, nzn + n - 1);
    int brc, brn;
    for (int j = 0; j < n - 1;j++)
    {
        if (nzn[j] != j + 1)brn++;
    }
    for (int j = 0; j < n - 1;j++)
    {
        if (nzc[j] != j + 1)brc++;
    }
        cout<<2<<" "<<1;
    return 0;
}