Shaass has decided to hunt some birds. There are n horizontal electricity wires aligned parallel to each other. Wires are numbered 1 to n from top to bottom. On each wire there are some oskols sitting next to each other. Oskol is the name of a delicious kind of birds in Shaass's territory. Supposed there are a_{i} oskols sitting on the i-th wire. $40$ 

Sometimes Shaass shots one of the birds and the bird dies (suppose that this bird sat at the i-th wire). Consequently all the birds on the i-th wire to the left of the dead bird get scared and jump up on the wire number i - 1, if there exists no upper wire they fly away. Also all the birds to the right of the dead bird jump down on wire number i + 1, if there exists no such wire they fly away. 

Shaass has shot m birds. You're given the initial number of birds on each wire, tell him how many birds are sitting on each wire after the shots.


-----Input-----

The first line of the input contains an integer n, (1 ≤ n ≤ 100). The next line contains a list of space-separated integers a_1, a_2, ..., a_{n}, (0 ≤ a_{i} ≤ 100). 

The third line contains an integer m, (0 ≤ m ≤ 100). Each of the next m lines contains two integers x_{i} and y_{i}. The integers mean that for the i-th time Shaass shoot the y_{i}-th (from left) bird on the x_{i}-th wire, (1 ≤ x_{i} ≤ n, 1 ≤ y_{i}). It's guaranteed there will be at least y_{i} birds on the x_{i}-th wire at that moment.


-----Output-----

On the i-th line of the output print the number of birds on the i-th wire.


-----Examples-----
Input
5
10 10 10 10 10
5
2 5
3 13
2 12
1 13
4 6

Output
0
12
5
0
16

Input
3
2 4 1
1
2 2

Output
3
0
3

Difficulty: interview

Starter code:

Solutions:
rd  = lambda: list(map(int, input().split()))

n, = rd()
a = [0] + rd() + [0]
for i in range(rd()[0]):
  x, y = rd()
  a[x-1] += y-1
  a[x+1] += a[x]-y
  a[x  ] = 0
print('\n'.join(map(str, a[1:1+n])))

rd  = lambda: list(map(int, input().split()))

n, = rd()
a = [0] + rd() + [0]
for _ in range(rd()[0]):
  x, y = rd()
  a[x-1] += y-1
  a[x+1] += a[x]-y
  a[x  ] = 0
print('\n'.join(map(str, a[1:-1])))

n = int (input())
a = list(map(int, input().split()))
m = int (input())
for i in range(m):
    x,y = map(int, input().split())
    x-= 1
    if x > 0 :
        a[x - 1] += y - 1
    if x < n - 1 :
        a[x + 1] += a[x] - y
    a[x] = 0
for i in range(n): 
    print(a[i])

n = int(input())
v = list(map(int,input().split()))
k = int(input())
for i in range(k):
    x,y = list(map(int,input().split()))
    x -= 1
    if x>0: v[x-1] += y-1
    if x<n-1: v[x+1] += v[x]-y
    v[x] = 0

for x in v:
    print(x)


n=int(input())
a=list(map(int,input().split()))
m=int(input())
for i in range(0,m):
    x,y=list(map(int,input().split()))
    x=x-1
    if(x>0):
        a[x-1]+=y-1
    if(x<n-1):
        a[x+1]+=a[x]-y
    a[x]=0

for x in a:
    print (x)


n = int(input())

arr = []
arr.append (0)
for x in (input().split()):
    arr.append (int(x))
#arr.append (input().split())
arr.append (0)

m = int(input())

for i in range(m):
    x,y = list(map (int, input().split()))

    #print (x)
    #print (y)
    #print (arr)
    
    arr[x-1] += y - 1
    arr[x+1] += arr[x] - y
    arr[x] = 0

for i in range (1, n + 1):
    print(arr[i])


n=int(input())

s=input().split()

for i in range(n):
    s[i]=int(s[i])

m=int(input())
if(n==1):
    for i in range(m):
        x=input()
    if(m==0):
        print(s[0])
    else:
        print(0)

else:
    for i in range(m):
        x,y=list(map(int,input().split()))
        x-=1
        if(x==0):
            s[x]-=(y)
            s[x+1]+=s[x]
            s[x]=0
        elif(x==n-1):
            s[x]-=(s[x]-y)+1
            s[x-1]+=s[x]
            s[x]=0
        else:
            s[x-1]+=y-1
            s[x]-=y
            s[x+1]+=s[x]
            s[x]=0

    for item in s:
        print(item)
        


3

n = int(input())
a = list(map(int, input().split()))
m = int(input())
for _ in range(m):
    x, y = list(map(int, input().split()))
    if x > 1:
        a[x - 2] += y - 1
    if x < n:
        a[x] += a[x - 1] - y
    a[x - 1] = 0
print('\n'.join(map(str, a)))


import sys
my_file = sys.stdin
#my_file = open("input.txt", "r")
n = int(my_file.readline().strip("\n"))
a = [int(i) for i in my_file.readline().strip("\n").split()]
m = int(my_file.readline().strip("\n"))
x = []
y = []
for i in range(m):
    line = [int(k) for k in my_file.readline().strip("\n").split()]
    x.append(line[0]-1)
    y.append(line[1])
for x, y in zip(x, y):
    try:
        if x-1 >= 0:
            a[x-1] += y-1
    except:
        pass
    try:
        if x+1 < n:
            a[x+1] += a[x]-y
    except:
        pass
    a[x] = 0
for i in a:
    print(i)

n=int(input())
q=input().split(" ")
a=[None]*n
for i in range(0,n) :
    a[i]=int(q[i])
m=int(input())
for i in range(0,m) :
    q=input().split(" ")
    if int(q[0])!=n and int(q[0])!=1 :
        a[int(q[0])-2]=a[int(q[0])-2]+int(q[1])-1
        a[int(q[0])]=a[int(q[0])]+a[int(q[0])-1]-int(q[1])
        a[int(q[0])-1]=0
    if int(q[0])==n :
        if n!=1 :
            a[int(q[0])-2]=a[int(q[0])-2]+int(q[1])-1
            a[int(q[0])-1]=0
        else :
            a[int(q[0])-1]=0
    if int(q[0])==1 :
        if n!=1 :
            a[int(q[0])]=a[int(q[0])]+a[int(q[0])-1]-int(q[1])
            a[int(q[0])-1]=0
        else :
            a[int(q[0])-1]=0
for i in range(0,n) :
    print(a[i])


n = int(input())
a = [0] + list(map(int, input().split())) + [0]
for i in range(int(input())):
    x, y = map(int, input().split())
    a[x - 1] += y - 1
    a[x + 1] += a[x] - y
    a[x] = 0
for i in range(1, n + 1):
    print(a[i])

n = int(input())
a = list(map(int, input().split()))
m = int(input())
for i in range(m):
    x, y = list(map(int, input().split()))
    x -= 1
    if x > 0: a[x-1] += y-1
    if x < n-1: a[x+1] += a[x]-y
    a[x] = 0

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



input()
a=list(map(int,input().split()))
size=int(input())
for i in range(size):
    x,y=list(map(int,input().split()))
    if x-1>0:
        a[x-2]+=y-1
    if x<len(a):
        a[x]+=a[x-1]-y
    a[x-1]=0
for i in a:
    print(i)


birds = int(input())
total = list(map(int, input().split()))
shots = int(input())
if birds == 1 and shots == 1:
    print(0)
    return
if birds == 1 and shots == 0:
    print(total[0])
    return
for i in range(shots):
    x, y = tuple(map(int, input().split()))
    x = x - 1
    if x == 0:
        total[1] += total[0] - y
    elif x == len(total)-1:
        total[x - 1] += y - 1
    else:
        total[x + 1] += total[x] - y
        total[x - 1] += y - 1
    total[x] = 0
for i in total:
    print(i)


__copyright__ = ''
__author__ = 'Son-Huy TRAN'
__email__ = "sonhuytran@gmail.com"
__doc__ = ''
__version__ = '1.0'


def main() -> int:
    n_wires = int(input())
    birds_in_wires = [0] + [int(word) for word in input().split()]
    n_shots = int(input())

    for i in range(n_shots):
        (x, y) = map(int, input().split())
        birds = birds_in_wires[x]
        left_birds = y - 1
        right_birds = birds - y
        birds_in_wires[x] = 0

        if x > 1:
            # left birds jump up
            birds_in_wires[x - 1] += left_birds

        if x < n_wires:
            # right birds jump down
            birds_in_wires[x + 1] += right_birds

    print('\n'.join([str(birds_in_wires[i]) for i in range(1, n_wires + 1)]))

    return 0


def __starting_point():
    (main());return
__starting_point()

n = int(input())
arr = [0] + list(map(int, input().split())) + [0]
m = int(input())
for i in range(m):
    a, b = map(int, input().split())
    arr[a - 1] += b - 1
    arr[a + 1] += arr[a] - b
    arr[a] = 0
print(*arr[1:-1], sep = '\n')

from sys import stdin

stdin.readline()
a = list()
a.append(0)
for x in stdin.readline().strip().split(): a.append(int(x))
a.append(0)
m = int(stdin.readline().strip())
for i in range(m):
    x,y = [ int(x) for x in stdin.readline().strip().split() ]
    a[x-1] += y-1
    a[x+1] += a[x]-y
    a[x] = 0
print('\n'.join([ str(x) for x in a[1:-1] ]))

    


from sys import stdin

def main():
    '''
    name: Kevin S. Sanchez
    '''
    inp = stdin
    wires = int(inp.readline())
    Lwires = list(map(int, inp.readline().split()))
    nums = int(inp.readline())
    electro = dict()
    for i in range(0,wires):
        electro[str(i)] = Lwires[i]
    
    for i in range(0,nums):
        x,y = list(map(int, inp.readline().split()))
        x = x-1 
        temp = electro[str(x)] - 1
        left = y-1
        right = temp - left
        prox, ante = x+1, x-1
        electro[str(x)] = 0
        if (prox < wires and prox >= 0):
            electro[str(prox)] = electro[str(prox)] + right

        if (ante >= 0 and ante < wires):
            electro[str(ante)] = electro[str(ante)] + left

    for i in range(0,wires):
        print(str(electro[str(i)]))
        
main()


input()
a=[int(i)for i in input().split()]
a=[0]+a+[0]
b=int(input())
while b>0:
 c=[int(i)for i in input().split()]
 a[c[0]-1]+=c[1]-1
 a[c[0]+1]+=a[c[0]]-c[1]
 a[c[0]]=0
 b-=1
for i in range(len(a)-2):
 print(a[i+1])

n = int(input())
a = list(map(int,input().split()))
m = int(input())
kill = []
for i in range(m):
    kill.append(list(map(int,input().split())))
if n == 1 and m == 1:
    print(0)
elif m == 0:
    for i in range(n):
        print(a[i])
else:
    for i in range(m):
        index = kill[i][0] - 1
        killed = kill[i][1]
        if index == 0 :
            a[index + 1] += a[index] - killed
            a[index] = 0
            
        elif index == n-1:
            a[index -1] += killed - 1
            a[index] = 0
        else:
            a[index-1] += killed -1
            a[index+1] += a[index] - killed
            a[index] = 0

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


n = int(input())
w = [int(x) for x in input().split()]
for i in range(int(input())):
    x, y = (int(x) for x in input().split())
    if x > 1:
        w[x - 2] += y - 1
    if x < n:
        w[x] += w[x - 1] - y
    w[x - 1] = 0
for b in w:
    print(b)

import sys
import math

n = int(sys.stdin.readline())
an = [int(x) for x in (sys.stdin.readline()).split()]
m = int(sys.stdin.readline())

for i in range(m):
    x, y = [int(x) for x in (sys.stdin.readline()).split()]
    x -= 1
    if(x - 1 >= 0):
        an[x - 1] += y - 1
    if(x + 1 < n):
        an[x + 1] += an[x] - y
        
    an[x] = 0
    
for i in an:
    print(i)
    



n = int(input())
arr = list(map(int, input().split()))
m = int(input())

for i in range(m):
	a, b = list(map(int, input().split()))
	a -= 1
	if a > 0:
		arr[a-1] += b - 1
	if a < n - 1:
		arr[a+1] += (arr[a] - b)
	arr[a] = 0

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



n = int(input())
l = [int(x) for x in input().split()]
m = int(input())
for i in range(m):
	a, b = [int(x) for x in input().split()]
	if a != 1:
		l[a - 2] += b - 1
	if a != n:
		l[a] += l[a - 1] - b
	l[a - 1] = 0
for i in l:
	print(i)


3

import sys

#deb = print
def deb(*a): pass

_ = sys.stdin.readline()

birds = sys.stdin.readline().split(" ")
birds [-1] = birds[-1].strip("\n")

_ = sys.stdin.readline()

shoot_rec = []
for l in sys.stdin.readlines():
    l = l.split(" ")
    l[1] = l[1].strip("\n")
    shoot_rec.append(l)

lines = []
for n in birds:
    n = int(n)
    lines.append(n)

deb(lines)


for line, bird in shoot_rec:
    deb(line, bird)

    line = int(line) - 1
    bird = int(bird)

    # left
    if line != 0:
        lines[line - 1] += bird - 1

    # right
    if line != len(lines) - 1:
        lines[line + 1] += lines[line] - bird

    # Killed and Move
    lines[line] = 0

    deb(lines)



deb("#########")
for i in lines:
    print(i)