#include #define endl '\n' using namespace std; const int MAXN=1e6+5; int n; bool used[MAXN]; int ptr=0; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); freopen("prefmex.in","r",stdin); freopen("prefmex.out","w",stdout); cin>>n; for(int i=0;i>a; used[a]=1; while(used[ptr]) ptr++; cout<