模拟
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e7 + 5;
short int used[N];
int n;
int main(){
cin >> n;
int mx = 0, mn = 2e9;
int x;
while(cin >> x){
used[x] ++;
mx = max(mx, x);
mn = min(mn, x);
}
int chong, lou;
for(int i = mn; i <= mx; i ++ ){
if(used[i] != 1){
if(used[i]) chong = i;
else lou = i;
}
}
cout << lou << " " << chong;
return 0;
}