#include <bits/stdc++.h>
using namespace std;

int n;
const int N = 1e5 + 5;
int p[N], parent[N];

void make_set(){
      // Đặt nút "cha" của mỗi tập hợp là chính nó
      for (int i = 1; i <= n; i++) parent[i] = i;
}

int find(int x){
      // Ta sử dụng kĩ thuật nén đường đi để tối ưu
      if (x == parent[x]) return x;
      int p = find(parent[x]);
      parent[x] = p;
      return p;
}

// Ở bài toán này thì không cần thao tác Set Union

void input(){
      cin >> n;
      make_set();
      for (int i = 1; i <= n; i++) cin >> p[i];
}

void solve(){
      for (int i = 1; i <= n; i++){
            // Tìm vị trí thích hợp
            int pos = find(p[i]);

            cout << pos << " ";
            // Cập nhật lại thành vị trí khác phù hợp
            parent[pos] = parent[pos % n + 1];
      }
}

int main(){
      input();
      solve();

      return 0;
}