/* `
`` `
. ` .g,`
Welcome To My Coding Space! .MMe `(F(#~ `.J,
`.M/7b. dD.N; (#=#:
`` db (m.#` Wl(@ jF `
`` ` ` ` ..+kMMN;_(Y> `(TD d$..gHN_
` `` ...... ` ` ` `..gMB61+1+dK `- `. .TM@^(d%
`` `` ..JggHHMMHHYYTHMMMNmgJ.. .kB6z?1+z1+
+H8+=??=?=?=???=?=?=z1&z1?==?1dM?===?=?=?+dNy+?=?jM@ ` ?WNe+zO>dNcHmJ1+1JMMR1?z??Ne1dM9+?(MF(MI+jMf .`.``.`.. (TNaHr`.`.TNmN:(MR+?zMK(M$` `.`.``dF `
J#<=1;?Wp .``.` J#>dN, ..``.`dF`
`_UmMn .`..`..`..`. JMYT1<;;;>>>>>;>>?Wo ..`. dK1=dN,`..``.MN+
.dMMe .`.``.`.`.` d#<;>>>>;>>>>;>>>>(N,`.. -MK1llvWm. JM?Mp. ` `
` .M9+?Me`.`..`.`.`` JN(>;>>;>>;>>>;>>>>>>>;>>>>>;>>>>>>>>>>>>>>><(W$(M8TIllllllllllllllllzvMo ` ` `
(#1?==1?===z?TNa,.` `` (Ne<<>>>>><;><;jgMMY1HK1lllllllllllllllllllJMp `
.Ne&g&x1=?=?==?1zTHNmJ-...dNgJ++++&ggMH9=~ .M9Izlllllllllllllllllll1WF `
` _???MK<=??=??1z?(MM@!d#M#Y""""=
#define rep(i,a,b) for(int i=a;i struct MaxFlow {
struct edge { int to, reve; V cap; edge(int t, int r, V c) : to(t), reve(r), cap(c) {} };
int MV; vector> E; vector itr, lev;
MaxFlow() {} MaxFlow(int n) { init(n); }
void init(int n) { MV = n; itr = vector(MV), lev = vector(MV); E = vector>(MV); }
void add_edge(int x, int y, V cap, bool undir = false) { E[x].push_back(edge(y, (int)E[y].size(), cap));
E[y].push_back(edge(x, (int)E[x].size() - 1, undir ? cap : 0)); }
void bfs(int cur) { rep(i, 0, MV) lev[i] = -1; queue q; lev[cur] = 0; q.push(cur);
while (q.size()) { int v = q.front(); q.pop();
for(auto e : E[v]) if (e.cap>0 && lev[e.to]<0) lev[e.to] = lev[v] + 1, q.push(e.to); } }
V dfs(int from, int to, V cf) { if (from == to) return cf;
for (; itr[from]cap>0 && lev[from]to]) {
V f = dfs(e->to, to, min(cf, e->cap));
if (f>0) { e->cap -= f; E[e->to][e->reve].cap += f; return f; }
} } return 0; }
V maxflow(int from, int to) { V fl = 0, tf;
while (1) { bfs(from); if (lev[to]<0) return fl;
rep(i, 0, MV) itr[i] = 0; while ((tf = dfs(from, to, numeric_limits::max()))>0) fl += tf;
}
}
};
struct BipartiteMatching {
int N, M; MaxFlow mf;
BipartiteMatching(int n, int m) : N(n), M(m) { mf.init(n + m + 2); }
void add_edge(int a, int b) { mf.add_edge(a, N + b, 1); }
int match() {
rep(a, 0, N) mf.add_edge(N + M, a, 1);
rep(b, 0, M) mf.add_edge(N + b, N + M + 1, 1);
return mf.maxflow(N + M, N + M + 1); }
int whois(int a) {
for (auto e : mf.E[a]) if (e.cap == 0) return e.to - N;
return -1;
}
};
//---------------------------------------------------------------------------------------------------
int N, A[50];
//---------------------------------------------------------------------------------------------------
void _main() {
cin >> N;
rep(i, 0, N) cin >> A[i];
BipartiteMatching bm(N, N);
rep(i, 0, N) rep(j, 0, N) if (A[i] != j) bm.add_edge(i, j);
if (bm.match() != N) {
printf("-1\n");
return;
}
rep(i, 0, N) printf("%d\n", bm.whois(i));
}