#include <bits/stdc++.h>

using namespace std;

int brojac;
int a [4],n,b;
string s;
int main()
{

cin>>n;
 for(int i=0;i<n;i++)
cin>>a[i];


if(a[0]>=a[1])
swap(a[0],a[1]);





cout<<a[0]<<" "<<a[1]<<endl;


return 0;
}