Bobby has decided to hunt some Parrots. There are n horizontal branch of trees aligned parallel to each other. Branches are numbered 1 to n from top to bottom. On each branch there are some parrots sitting next to each other. Supposed there are a[i]$a[i]$ parrots sitting on the i−th$ i-th$ branch.  
Sometimes Bobby shots one of the parrot and the parrot dies (suppose that this parrots sat at the i−th$i-th$ branch). Consequently all the parrots on the i−th$i-th$ branch to the left of the dead parrot get scared and jump up on the branch number i − 1$i - 1$, if there exists no upper branch they fly away. Also all the parrots to the right of the dead parrot jump down on branch number i + 1$i + 1$, if there exists no such branch they fly away.  
Bobby has shot m parrots. You're given the initial number of parrots on each branch, tell him how many parrots are sitting on each branch after the shots.  

-----Input:-----
The first line of the input contains an integer N$N$. The next line contains a list of space-separated integers a1, a2, …, an.
The third line contains an integer M$M$. Each of the next M$M$ lines contains two integers x[i]$x[i]$ and y[i]$y[i]$. The integers mean that for the i-th time Bobby shoot the y[i]-th (from left) parrot on the x[i]-th branch. It's guaranteed there will be at least y[i] parrot on the x[i]-th branch at that moment.   

-----Output:-----
On the i−th$i-th$ line of the output print the number of parrots on the i−th$i-th$ branch.

-----Constraints-----
- 1≤N≤100$1 \leq N \leq 100$
- 0≤a[i]≤100$0 \leq a[i] \leq 100$
- 0≤M≤100$0 \leq M \leq 100$
- 1≤x[i]≤n$1 \leq x[i] \leq n$, 1≤y[i]$1 \leq y[i] $

-----Sample Input:-----
5

10 10 10 10 10

5

2 5

3 13

2 12

1 13

4 6   
3

2 4 1

1

2 2   

-----Sample Output:-----
0

12

5

0

16   
3

0

3

Difficulty: interview

Starter code:

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

# cook your dish here
N = int(input())
a = list(map(int,input().split()))
M = int(input())
for _ in range(M):
    x,y = map(int,input().split())
    t = x-1
    if(t-1>=0):
        a[t-1] = a[t-1] + (y -1)
    if(t+1<=N-1):
        a[t+1] = a[t+1] + (a[t] - y)
    a[t] = 0
    
      
for j in a:
    print(j)

Nb=int(input())
tree=list(map(int,input().split()))
Ns=int(input())
for i in range(Ns):
    branch,bird=map(int,input().split())
    branch-=1
    bird-=1
    u=bird
    l=tree[branch]-bird-1
    tree[branch]=0
    if branch-1>=0:
        tree[branch-1]+=u
    try:
        tree[branch+1]+=l
    except:pass
    #print(tree)
for nb in tree: 
    print(nb)

n = int(input())
branches = list(map(int,input().split()))

for i in range(int(input())):
	branch, parrot = list(map(int,input().split()))

	

	if branch>1:
		branches[branch-2] = branches[branch-2]+ parrot-1

	if branch<n:
		branches[branch] = branches[branch] + branches[branch-1] - parrot

	branches[branch-1] = 0


for i in branches:
	print(i)


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

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

N = int(input())
branch = list(map(int,input().split()))
t = int(input())
for i in range(t):
    x, y = list(map(int,input().split()))
    if(x==1):
        try:
            branch[x] += branch[x-1] - y
        except:
            ...
    else:
        try:
            branch[x-2] += y - 1
        except:
            ...
        try:
            branch[x] += branch[x-1] - y
        except:
            ...
    branch[x-1] = 0
for j in branch:
    print(j)


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


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


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

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

# cook your dish here
n=int(input())
a=[int(X) for X in input().split()]
a=[0]+a
for j in range(int(input())):
    x,y = map(int,input().split())

    if x!=1:
        a[x-1]+=y-1
    if x!=n:
        a[x+1]+=(a[x]-y)
    a[x]=0
print(*a[1:],sep='\n')

n = int(input())
arr = list(map(int, input().split(" ")))
m = int(input())
for _ in range(m):
    branch, ind_from_left = map(int, input().split(" "))
    if branch > 1 and ind_from_left != 1:
        arr[branch - 2] += ind_from_left - 1
    if branch < n and ind_from_left != arr[branch - 1]:
        arr[branch] += arr[branch - 1] - ind_from_left
    arr[branch - 1] = 0
for b in arr:
    print(b)

# cook your dish here
while True:
    try:
        n=int(input())
        lst=[int(i) for i in input().split()]
        for _ in range(int(input())):
            a,b=[int(i) for i in input().split()]
            a=a-1
            if (a-1)>=0:
                lst[a-1]+=b-1
            if (a+1)<n:
                lst[a+1]+=lst[a]-b
            lst[a]=0
        for i in lst:
            print(i)
    except:
        break


# cook your dish here
n=int(input())
l=list(map(int,input().split()))
q=int(input())
for u in range(q):
    x,y=list(map(int,input().split()))
    x-=1
    if(x-1>=0):
        l[x-1]+=(y-1)
    if(x+1<n):
        l[x+1]+=(l[x]-y)
    l[x]=0
for i in l:
    print(i)


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

#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

n = inp()
x = ip()
m = inp()
for i in range(m):
    ind,pos = ip()
    ind -= 1
    t = x[ind]
    x[ind] = 0
    if ind >= 1:
        x[ind-1] += pos-1
    if ind <= n-2:
        x[ind+1] += t-pos
for i in range(n):
    print(x[i])

n = int(input())
A = list(map(int, input().split()))

m = int(input())
for _ in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1

    left = y
    right = A[x] - left - 1
    
    A[x] = 0
    
    if x - 1 >= 0:
        A[x - 1] += left
    if x + 1 < n:
        A[x + 1] += right
    
for a in A:
    print(a)