#include <bits/stdc++.h>
#define ll int
#define el "\n"
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define __ROOT__ int main()
#define fi first
#define se second
#define M 1000000007
#define MAXN 1000001
#define GIOIHAN 1000001
#define BLOCK_SIZE 425
#define MAX_NODE 1001001
#define ALPHA_SIZE 26
#define compare(v) sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); // dùng để nén sort mảng compare
using namespace std;
ll n, q ;
ll arr[MAXN],  sz[MAXN], par[MAXN];
vector<ll>res;
void init() {
    cin>>n ;
    for(ll i = 1  ; i <  MAXN ; i ++ ) sz[i] = 1, par[i] = i ;
}
ll find_set(ll a ) {
    if(par[a] == a) return a;
    return par[a] = find_set(par[a]);
}
void union_set(ll x, ll y ) {
    x = find_set(x) ;
    y = find_set(y);
    if(x== y ) return ;
    else {
//        if(sz[x]< sz[y]) swap(x,y) ;
        par[y] = x;
//        sz[x] += sz[y];
    }
}
void solve() {
for(ll i = 1; i  <= n  ; i ++ ){
    ll x; cin>>x;
    x = find_set(x) ;
    res.push_back(x);
    union_set( ((x+1) %  n == 0 ? n : (x+1)%n  ) ,x);
}
for(ll i = 0 ; i < res.size( ) ; i ++ ) cout<<res[i]<< " " ;
}

__ROOT__ {
    fast;
    init();
    solve();
}
