using namespace std;
int main ()
{
    int n;
    cin>>n;
    int nezadraskani[n];
    for(int i = 0; i<n; i++)
    {
        cin>>nezadraskani[i];
    }
    for(int i = 0; i<n; i++)
    {
        if(nezadraskani[i]%2 == 0)
        {
            max(nezadraskani[i], nezadraskani[i+1]) - n;

        }
        else
        {
             max(nezadraskani[i], nezadraskani[i+1]) - n - 1;

        }
        cout<<max(nezadraskani[i], nezadraskani[i+1]) - n<<" "<< max(nezadraskani[i], nezadraskani[i+1]) - n - 1;
;
    }
    return 0;
}
