import sys
arr_size, arr_ind_size = map(int, sys.stdin.readline().split())
arr = list(map(int, sys.stdin.readline().split()))
arr_ind = list(map(int, sys.stdin.readline().split()))
for i in range(arr_size):
    for j in range(arr_ind_size):
        if i == (arr_ind[j] - 1):
            print(i, j)
            arr[i] += 1
print(' '.join(map(str, arr)))