def copy(a,b,size): b[:size] = a[:size] return b[:size] + b[size -1 + 1:] a1,b1,size = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) for i in copy(a,b,size): print(i,end= ' ')