# # 二部グラフの最大マッチング # import sys sys.setrecursionlimit(10 ** 6) def max_bipartite_matching(g): def rec(p, left, right, used) -> bool: for i in range(len(right)): if g[p][i] and right[i] == -1: left[p] = i right[i] = p return True for i in range(len(right)): if g[p][i] and not used[i]: used[i] = True if rec(right[i], left, right, used): left[p] = i right[i] = p return True return False left = [-1] * len(g) right = [-1] * len(g[0]) cnt = 0 for i in range(len(left)): used = [False] * len(left) if rec(i, left, right, used): cnt += 1 return cnt, left, right N = int(input()) a = [int(input()) for _ in range(N)] g = [] for i in range(N): g.append([True] * N) if a[i] < N: g[i][a[i]] = False cnt, left, right = max_bipartite_matching(g) if cnt == len(left): for e in left: print(e) else: print(-1)