#include using namespace std; int arr[105] , brr[105]; void solve(){ mt19937 mt(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<> dis(0, 1e9); int n; cin >> n; for(int i = 0;i < n;i++){ cin >> brr[i]; arr[i] = i; } int cnt = 0; while(cnt < 100){ shuffle(arr,arr+n,mt); int f = 0; for(int i = 0;i < n;i++){ if(brr[i] == arr[i])f = 1; } if(!f)break; cnt++; } if(cnt == 100){ cout << -1 << endl; }else{ for(int i = 0;i < n;i++)cout << arr[i] << endl; } } int main(){ solve(); return 0; }