#include using namespace std; #define rep(i,a,b) for(int i=a;i vl; int main() { int N; cin >> N; vl z(N); rep(i, 0, N) cin >> z[i]; cout << z[N - 1] << " " << z[0] << endl; }