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()))

loc = [False] * 2020
for x in X:
    loc[x] = True

for m in range(M):
    now = X[A[m] - 1]
    new = X[A[m] - 1] + 1

    if now == 2019:
        continue

    if not loc[new]:
        X[A[m] - 1] = new
        loc[now] = False
        loc[new] = True

for x in X:
    print(x)

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

for a in A:
    i=a-1
    mem=X[i]+1
    if mem in X or mem==2020:
        continue
    else:
        X[i]=mem
for x in X:
    print(x)

Python: n=int(input())
x=list(map(int,input().split()))
m=int(input())
a=list(map(int,input().split()))
ax=[]
for j in range(m):
    if x[a[j]-1]+1 not in x and x[a[j]-1]<=2018:
        x[a[j]-1]+=1
for i in x:
    print(i)

Python: N = int(input())
*X, = map(int, input().split())
for i in range(N):
    X[i] -= 1
U = [0]*2019
for i, x in enumerate(X):
    U[x] = 1
M = int(input())
*A, = map(int, input().split())
for a in A:
    x = X[a-1]
    if x < 2018 and not U[x+1]:
        U[x+1] = 1; U[x] = 0
        X[a-1] += 1
for x in X:
    print(x+1)

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


for f in a:
  #print(f,n)
  if x[f-1] < 2019:
    if f == n:
      #print(f,x[f-1])
      x[f-1] += 1
      
    elif x[f-1]+1 != x[f]:
      #print(f,x[f-1])
      x[f-1] += 1

for j in x:
  print(j)

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

mas=[False]*2022

for i in x:
    mas[i]=True

m=int(input())
a=list(map(int,input().split()))

for i in range(m):
    now=x[a[i]-1]
    if not mas[now+1] and now!=2019:
        mas[now]=False
        mas[now+1]=True
        x[a[i]-1]+=1

for i in range(2020):
    if mas[i]:
        print(i)

Python: import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n = int(input())
    xx = LI()
    m = int(input())
    aa = LI()
    line = [0] * 2020
    pos = [-1] * (n + 1)
    for a, x in enumerate(xx, 1):
        line[x] = a
        pos[a] = x
    for a in aa:
        if pos[a]==2019 or line[pos[a] + 1] != 0: continue
        line[pos[a]] = 0
        line[pos[a] + 1] = a
        pos[a] += 1
    for x in pos[1:]:
        print(x)

main()

Python: piece_num = int(input())                                # 駒の数
piece_pos_list = [int(s) for s in input().split()]      # 駒の位置リスト
ope_num = int(input())                                  # 操作回数
ope_list = [int(s) for s in input().split()]            # 操作の対象とする駒の番号リスト

MAX_SQUARE = 2019

for i in range(ope_num):
    if (piece_pos_list[ope_list[i] - 1] != MAX_SQUARE)\
       and ((piece_pos_list[ope_list[i] - 1] + 1) not in piece_pos_list):
        # 駒を1つ進める
        piece_pos_list[ope_list[i] - 1] += 1

# 結果を出力
for i in range(piece_num):
    print(piece_pos_list[i])

Python: import sys

input()
x = list(map(int,sys.stdin.readline().split()))
input()
a = tuple(map(int,sys.stdin.readline().split()))
for i in range(len(a)):
    idx = a[i] - 1
    # print(idx, x[idx])
    if x[idx] == 2019:
        pass
    elif idx+1 == len(x):
        x[idx] += 1
    elif x[idx]+1 != x[idx+1]:
        x[idx] += 1

for i in x:
    print(i)

Python: a=int(input())
array2019=[]
array_num=[]
array2019+=map(int,input().split(" ",a-1))
b=int(input())
array_num+=map(int,input().split(" ",b-1))

for n in array_num:
    if array2019[n-1]+1 in array2019 or array2019[n-1]==2019:
        pass
    else:array2019[n-1]+=1

for m in array2019:
    print(m)

Python: #!/usr/bin/python3

import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys


def main():
    N = read_int()
    X = read_ints()
    M = read_int()
    A = read_ints()
    print(*solve(N, X, M, A), sep='\n')


def solve(N, X, M, A):
    ar = [0] * 2020
    pos = [0] * (N + 1)
    for i, x in enumerate(X):
        ar[x] = i + 1
        pos[i + 1] = x

    for a in A:
        x = pos[a]
        if x != 2019 and ar[x + 1] == 0:
            ar[x] = 0
            ar[x + 1] = a
            pos[a] = x + 1

    return pos[1:]


###############################################################################
# AUXILIARY FUNCTIONS

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Python: n=int(input())
X=[]
X=input().split()
X=[int(u) for u in X]
m=int(input())
A=[]
A=input().split()
A=[int(u) for u in A]
for i in range(0,m):
    a=A[i]
    p=0
    for u in range(a,n):
        if (X[a-1]+1)==X[u]:
            p=p+1
    if p==0:
        if X[a-1]!=2019:
            X[a-1]=X[a-1]+1
for i in range(0,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]
    if x[num-1] + 1 in x:
        continue
    elif x[num-1] == 2019:
        continue
    else:
        x[num-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()))
output = [0] * 2019

for i in x:
    output[i - 1] = 1


for k in range(m):
    count = 0
    for l in range(2019):
        if output[l] == 1:
            count += 1


        if count == a[k]:
            if l == 2018:
                break

            if output[l + 1] == 0:
                output[l], output[l + 1] = 0, 1

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

Python: N=int(input())
X=list(map(int,input().split()))
M=int(input())
A=list(map(int,input().split()))
for i in range(M):
    X[A[i]-1]+=1
    if A[i]!=N:
        if X[A[i]-1]>=X[A[i]]:
            X[A[i]-1]=X[A[i]]-1
    if X[A[i]-1]>=2019:
        X[A[i]-1]=2019

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

Python: N = int(input())
koma = list(map(int, input().split()))
M = int(input())
order = list(map(int, input().split()))
koma.append(0)

for i in range(M):
    koma[order[i]-1] += 1
    if koma[order[i]-1] == koma[order[i]] or koma[order[i]-1] == 2020:
        koma[order[i]-1] -= 1

del koma[-1]
for v in koma:
    print(v)

Python: num = int(input())
L = [int(x) for x in input().split()]
L.append(2020)
input()
s = [int(x)-1 for x in input().split()]

for i in s:
    if L[i+1] > L[i] +1:
        L[i] += 1

for i in range(len(L) -1):
    print(L[i])

Python: N=int(input()) #コマの個数
X=list(map(int, input().split())) #コマの場所
M=int(input()) #回数
A=list(map(int, input().split())) #どこの変化

for i in range(0,M):
    #print(A)
    #print(M)
    #print(X[A[i]-1])
    
    if (X[A[i]-1]+1 not in X) and X[A[i]-1]+1 <=2019:
        #print("not in",X[A[i]-1]+1,X)
        s=X[A[i]-1]
        X.insert(A[i],X[A[i]-1]+1)
        #print("X ",X)
        #print(s)
        X.remove(s)
        #print(X)

#print(" ")

X.sort()    
for i in range(len(X)):
    print(X[i])