n, p, q = map(int, input().split()) A = list(map(int, input().split())) C = list(range(1, n+1)) import heapq heapq.heapify(C) B = [0]*n flag1 = False flag2 = False for i in range(n): a = A[i] temp = [] while C: x = heapq.heappop(C) if not flag2: if x < A[i]: temp.append(x) continue else: if x != q: B[i] = x break else: if flag1: B[i] = x break else: temp.append(x) continue else: if x != q: B[i] = x break else: if flag1: B[i] = x break else: temp.append(x) continue if B[i] == 0: #print(B) print(-1) exit() if B[i] == p: flag1 = True if not flag2: if B[i] > A[i]: flag2 = True while temp: y = temp.pop() heapq.heappush(C, y) if flag1 and flag2: print(*B) else: print(-1)