// 我就是为了来收割一波阅读量的
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
// set 的简单用法,这个C++,肯定学了
const int N = 1e6 + 10;
int a[N];
set<int>st;
int n;
int main()
{
ios::sync_with_stdio(false);
cin >> n;
for(int i = 0;i < n;i++)
{
cin >> a[i];
st.insert(a[i]);
}
if(n < 2){
cout << "Invalid Input" << endl;
}
else{
if(st.size() < 2){
cout << "There is no second smallest element" << endl;
}else{
int i = 0;
for(auto &x : st){
a[i ++] = x;
if(i > 1){
break;
}
}
cout << a[0] << ' ' << a[1] << endl;
}
}
return 0;
}