#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<utility>
#include<set>
#include<map>
#include<stack>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define stop char nyaa;cin>>nyaa;

void solve() {
	int n;
	cin >> n;
	vector<vector<int>> p(n);
	rep(i, n) {
		int x;
		cin >> x;
		--x;
		p[x].push_back(i+1);
	}
	vector<int> ans(n);
	stack<int> st;
	int cnt = 0;
	int cur = 0;
	while (cnt<n) {
		if (p[cur].size()) {
			int m = p[cur].size();
			rep(i, p[cur].size()) {
				st.push(p[cur][m - i - 1]);
			}
			p[cur].clear();
		}
		if (!ans[cur] && st.size()) {
			ans[cur] = st.top();
			++cnt;
			st.pop();
		}
		cur = (cur + 1) % n;
	}
	rep(i, n)cout << ans[i] << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	stop
		return 0;
}
