#include using namespace std; const int MN = 1e6 + 6; int n,a,t; bool b[MN]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); freopen("prefmex.in", "r", stdin); freopen("prefmex.out", "w", stdout); cin>>n; t=0; for(int i=1;i<=n;i++){ cin>>a; b[a]=1; if(a!=t)cout<