#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int A[n];
    for (int i = 0; i < n; ++i){
        cin >> A[i];
    }
    int temp;
    temp = A[0];
    A[0] = A[1];
    A[1] = temp;
    cout << A[0] << " " << A[1];

    return 0;
}