#include <bits/stdc++.h>

using namespace std;

int n, a[1000005];
int main(){
    cin >> n;
    for (int i = 1; i <= n; i++){
        scanf("%d" ,&a[i]);
    }
    if (n==2){
        cout << a[2] << " " << a[1] << endl;
    }


    return 0;
}