Go: package main

import (
	"fmt"
)

func main() {
	var n int // こま数

	_, _ = fmt.Scan(&n)

	xa := make([]int, n) // こま座標

	for i:= 0;i < n ; i++ {
		_, _ = fmt.Scan(&xa[i])
	}

	var m int // 操作数

	_, _ = fmt.Scan(&m)

	ma := make([]int, m) // 操作対象

	for i:= 0;i < m ; i++ {
		_, _ = fmt.Scan(&ma[i])
	}

	for _, v := range calc(xa, ma) {
		fmt.Println(v)
	}
}

func calc(xa []int, ma []int) []int {
	for _, v := range ma {
		if xa[v-1] < 2019 {
			if  len(xa) != v {
				if xa[v]-1 != xa[v-1] {
					xa[v-1]++
				}
			} else {
				xa[v-1]++
			}
		}
	}
	return xa
}

Python: N=int(input())
x=list(map(int,input().split()))
M=int(input())
a=list(map(int,input().split()))
F=True    
for i in a:
    for j in range(N):
        #print(x[i-1])
        if x[i-1]+1 == x[j] or x[i-1] ==2019:
            F=False
            break
    if F==True:
        x[i-1]+=1
    F=True
for i in range(N):
    print(x[i])

Python: N = int(input())
X = list(map(int, input().split())) + [2020]
M = int(input())
A = list(map(int, input().split()))

for a in A:
    if X[a-1]+1 == X[a]: continue
    else: X[a-1] += 1
    
for x in X[:N]:
    print(x)

Python: N = int(input())
p = [int(i) for i in input().split()]
input()
O = [int(i) for i in input().split()]
for x in O:
    if p[x - 1] == 2019:
        continue
    if x < N and p[x - 1] + 1 == p[x]:
        continue
    p[x - 1] += 1

for x in p:
    print(x)

Python: n = int(input())
a = [int(s) for s in input().split()]
m = int(input())
b = [int(r) for r in input().split()]

for i in range(m):
    h = a[b[i]-1] + 1
    if a.count(h) == 0 and h != 2020:
        a[b[i]-1] = h
for t in a:
    print(t)

Python: # -*- coding: utf-8 -*-
"""
Sugoroku and Pieces
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0653

"""
import sys


class Piece:
    def __init__(self, pos):
        self.pos = pos


def main(args):
    _ = input()                 #  N
    board = [None] * 2020
    pieces = [Piece(0)]
    for p in map(int, input().split()):
        x = Piece(p)
        board[p] = x
        pieces.append(x)
    _ = input()                 #  M
    for p in map(int, input().split()):
        if pieces[p].pos == 2019 or board[pieces[p].pos + 1] != None:
            continue
        pos = pieces[p].pos
        pieces[p].pos += 1
        board[pos] = None
        board[pos + 1] = pieces[p]
    for p in pieces[1:]:
        print(p.pos)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: S = [0]*2020

n = int(input())
X = [int(a) for a in input().split()]
for a in X:
  S[a] = 1

m = int(input())
M = [int(a) for a in input().split()]
for i in M:
  i = i - 1
  if X[i]+1 != 2020:
    if S[X[i]+1] == 0:
      S[X[i]+1] = 1
      S[X[i]] = 0
      X[i] = X[i]+1

for i in range(2020):
  if S[i] == 1:
    print(i)

Python: N=int(input())
Xin=input().split( )
X=[int(Xin[i]) for i in range(N)]

X.append(2020)
M=int(input())
Ain=input().split( )
A=[int(Ain[i]) for i in range(M)]

for t in range(M):
    j=A[t]-1
    if X[j]<X[j+1]-1:
        X[j]+=1
for i in range(N):
    print(X[i])

Python: n=int(input())
x=list(map(int,input().split()))
m=int(input())
a=list(map(int,input().split()))

for v in a:
    if x[v-1]+1 in x or x[v-1]==2019:
        x[v-1]=x[v-1]
    else:
        x[v-1]+=1
for i in range(n):
    print(x[i])

Python: def main():
    n = int(input())
    pieces = list(map(lambda x: int(x), input().split()))
    m = int(input())
    operations = list(map(lambda x: int(x), input().split()))
    res = {}
    ans = []

    for i in range(2019):
        res[i] = 0

    for i in pieces:
        res[i - 1] = 1

    for i in operations:
        piece = pieces[i - 1]
        if piece >= 2019:
            continue
            
        if res[piece] == 1:
            pass
        else:
            res[piece - 1] = 0
            res[piece] = 1
            if (pieces[i - 1] + 1) < 2019:
                pieces[i - 1] += 1

    for i in range(2019):
        if res[i] == 1:
            print(i + 1)

if __name__ == '__main__':
    main()

Python: n=int(input())
koma=list(map(int,input().split()))
koma.append(2020)
m=int(input())
mi=list(map(int,input().split()))
for i in mi:
    if koma[i]>koma[i-1]+1:
        koma[i-1]+=1
koma.remove(2020)
for i in koma:
    print(i)

Python: N = int(input())
X = [int(x) for x in input().split()]
M = int(input())
A = [int(a) for a in input().split()]

for i in range(M):
    new_p = X[A[i]-1] + 1
    if new_p in X or new_p == 2020:
        continue
    X[A[i]-1] = new_p

for i in X:
    print(i)

Python: def main():
    N = int(input())
    x = [-1] + [int(i) for i in input().split()]
    x_set = set(x)
    M = int(input())
    A = [int(i) for i in input().split()]
    for i in range(M):
        posi = A[i]
        next_posi = x[posi] + 1
        if next_posi in x_set or next_posi > 2019:
            continue
        x_set.discard(x[posi])
        x_set.add(next_posi)
        x[posi] += 1

    print(*x[1:], sep="\n")


if __name__ == '__main__':
    main()

Python: N = int(input())

BASYO = [int(i) for i in input().split()]

M = int(input())

KOMA = [int(i) for i in input().split()]

for i in range(M):
    
    X = KOMA[i] - 1
    
    if (N != X + 1 and 1 == BASYO[X+1] - BASYO[X]) or BASYO[X] == 2019:
        pass
    
    else:
        BASYO[X] += 1
for i in range(N):
    print(BASYO[i])

Python: N = int(input())
X = list(map(int, input().split()))
M = int(input())
A = list(map(int, input().split()))

MAX = 2019
MIN = 1

for i in range(M):
    if (X[A[i] - 1] + 1 in X) == False and X[A[i] - 1] != MAX:
        X[A[i] - 1] += 1

for i in range(N):
    print(X[i])

Python: tmp = [2020]*101
n = int(input())
X = list(map(int, input().split()))
m = int(input())
A = list(map(int, input().split()))
for i in range(n):
    tmp[i] = X[i]

for i in range(m):
    if (tmp[A[i]-1]+1) < tmp[A[i]]:
        tmp[A[i]-1] += 1

for i in range(n):
    print(tmp[i])

Python: n = int(input())
x = list(map(int,input().split()))
x.append(0)
m = int(input())
a = list(map(int,input().split()))
for i in a:
    i -= 1
    if x[i] != 2019 and x[i]+1 != x[i+1]:
        x[i] += 1
for i in range(n):
    print(x[i])

Python: N = int(input())
X = list(map(int, input().split()))
M = int(input())
A = list(map(int, input().split()))
for x in A:
    if X[x-1] + 1 in X or X[x-1] == 2019:
        continue
    else:
        X[x-1] += 1
for i in range(N):
    print(X[i])

Python: N = int(input())
X = list(map(int, input().split()))
M = int(input())
A = list(map(int, input().split()))

for i in range(M) :
  num = A[i] - 1
  x = X[num]
  if(x + 1 in X or x == 2019) :
    pass
  else :
    X[num] = x + 1

for i in range(N) :
  print(X[i])

Python: N = int(input())
X = [int(x) for x in input().split()]
M = int(input())
A = [int(x) for x in input().split()]

peace = {x: 0 for x in range(1, N + 1)}  # 駒
square = {x: 0 for x in range(1, 2020)}  # マス

for i in range(N):
    peace[i + 1] = X[i]
    square[X[i]] = i + 1

for i in range(M):
    if peace[A[i]] < 2019 and square[peace[A[i]] + 1] == 0:
        square[peace[A[i]] + 1] = A[i]
        square[peace[A[i]]] = 0
        peace[A[i]] += 1

for i in range(1, N + 1):
    print(peace[i])

Python: # 4
# 2 3 6 2019
# 2
# 1 3 4

N = int(input())
X = list(map(int, input().split()))  # 初期配置のリスト
M = int(input())
A = list(map(int, input().split()))  # 操作のリスト

# Aを読み込み、Nを操作
for j in A:
	if X[j - 1] == 2019:
		pass
	elif j <= N - 1:
		if X[j - 1] + 1 == X[j]:
			pass
		else:
			X[j - 1] = X[j - 1] + 1
	else:
		X[j - 1] = X[j - 1] + 1

# 結果出力
for k in X:
	print(k)

Python: n = int(input())
x = list(map(int, input().split()))
m = int(input())
a = list(map(int, input().split()))

for i in range(m):
    if x[a[i]-1]+1 in x or x[a[i]-1] == 2019:
        pass
    else:
        x[a[i]-1] += 1

for i in range(n):
    print(x[i])