Harryxun/stf_run huggingface dataset:
n = int(input())
v = map(int,input().split())
c = map(int,input().split())
cnt = 0
for i in range(len(n)):
    if int(str(v[i])) > int(str(c[i])):
        cnt += (int(str(v[i])) - int(str(c[i])))
    else:
        cnt += 0
print(cnt) 

### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if v[i] > c[i]:
        cnt += (v[i] - c[i])
print(cnt)
def main():
    """"ここに今までのコード"""

n = int(input())
A = [int(a) for a in input().split()]
mod=10**9+7

ans=0
for i in range(60):
    l=sum([a>>i & 1 for a in A])
    ans+= l*(n-l) <<i
    ans%= mod
    
print(ans) 

if __name__ == '__main__':
    main()

### FIXED CODE ###

a1,a2,a3=map(int, input().split()) 

if a1+a2+a3>=22:
    print("bust")
else:
    print("win")
import sys
import os
f = open("C:/Users/kazuki/Documents/python/import.txt","r")
sys.stdin = f

# -*- coding: utf-8 -*-
N,Q = map(int,input().split())
S = str(input())
ls =[]
rs = []
for i in range(0,Q):
 l,r = map(int,input().split())
 slice = S[l-1:r]
 cnt = slice.count("AC")
 print(cnt)


### FIXED CODE ###

N,Q = map(int,input().split())
S = (input())
cnt = [0] * (N + 1)
for i in range(N):
 if S[i:i+2] == "AC":
  cnt[i+1] = cnt[i] + 1
 else:
  cnt[i+1] = cnt[i]

for i in range(0,Q):
 l,r = map(int,input().split())
 print(cnt[r-1] - cnt[l-1])
def solve():
    from sys import stdin
    #f_i = stdin
    f_i = open('test_in_4')#
    
    mod = 10 ** 9 + 7
    
    N, K = map(int, f_i.readline().split())
    A = sorted(map(int, f_i.readline().split()))
    
    num = [1] * (N - K + 1)
    for i, j in zip(range(K, N), range(1, N)):
        num[j] = num[j-1] * i // j
    
    ans = sum(a * n % mod for a, n in zip(A[K-1:], num))
    ans -= sum(a * n % mod for a, n in zip(A, num[::-1]))
    
    print(ans % mod)

solve()

### FIXED CODE ###

def solve():
    from sys import stdin
    f_i = stdin
    
    mod = 10 ** 9 + 7
    
    N, K = map(int, f_i.readline().split())
    A = sorted(map(int, f_i.readline().split()))
    
    comb = 1
    ans = A[K-1] - A[N-K]
    for i, j in zip(range(K, N), range(1, N)):
        comb = comb * i * pow(j, mod - 2, mod) % mod
        ans += (A[i] - A[N-i-1]) * comb
        ans %= mod
    
    print(ans)

solve()
s = str(input())

print('Yes' if s.count(a)+s.count(b)==2 else 'No')

### FIXED CODE ###

s = str(input())

print('Yes' if s.count('a')==1 and s.count('b')==1 else 'No')
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
B=[]
for i in range(Q):
    B.append(list(map(int,input().split())))
sum=int(0)
AA=[int(0)]
for i in range(100000):
    AA.append(int(0))
#for i in range(100001):
#    AA[i]=A.count(int(i))
#for i in range(5):
#    print(AA[i])
sum=int(0)
for i in range(N):
    sum += A[i]
for i in range(Q):
    AA[(B[i][0])]=A.count(int((B[i][0])))
    A.replace(B[i][0],B[i][1])
#    AA[(B[i][1])]=A.count(int((B[i][1])))
    sum = sum + B[i][1]*AA[(B[i][0])]-B[i][0]*AA[(B[i][0])]
#    AA[(B[i][1])] = AA[(B[i][1])]+AA[(B[i][0])]
#    AA[(B[i][0])] = 0
    print(sum)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
Q=int(input())
B=[]
for i in range(Q):
    B.append(list(map(int,input().split())))
sum=int(0)
AA=[int(0)]
for i in range(100000):
    AA.append(int(0))
for i in A:
    AA[i]+=1 #A.count(int(i))
#for i in range(5):
#    print(AA[i])
sum=int(0)
for i in range(N):
    sum += A[i]
for i in range(Q):
#    AA[(B[i][0])]=A.count(int((B[i][0])))
#    A.replace(B[i][0],B[i][1])
#    AA[(B[i][1])]=A.count(int((B[i][1])))
    sum = sum + B[i][1]*AA[(B[i][0])]-B[i][0]*AA[(B[i][0])]
    AA[(B[i][1])] = AA[(B[i][1])]+AA[(B[i][0])]
    AA[(B[i][0])] = 0
    print(sum)
H, W  = map(int,input().split())
S = [list(map(str,input().split())) for i in range(H)]
char = "ABCDEFGHIJ"
for i in range(H):
    for j in range(W):
        if S[i][j] == "snuke":
            tmp = [i,j]
ans = str(char[tmp[1]]) + str(tmp[0]+1)
print(ans)

### FIXED CODE ###

H, W  = map(int,input().split())
S = [list(map(str,input().split())) for i in range(H)]
char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(H):
    for j in range(W):
        if S[i][j] == "snuke":
            tmp = [i,j]
ans = str(char[tmp[1]]) + str(tmp[0]+1)
print(ans)
import sys
import numpy as np

if sys.argv[-1] == 'ONLINE_JUDGE':
    cc_export()
    exit(0)
if sys.argv[-1] != 'LOCAL':
    from my_module import solve

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8(i8[:])')(main)
    cc.compile()

def main(A):
    return 0

A = np.ones(10, dtype=np.int32)
ans = main(A)
print(ans)


### FIXED CODE ###

from functools import lru_cache
import sys
sys.setrecursionlimit(10**7)

T = int(input())
INF = 10**18

for _ in range(T):
    N, A, B, C, D = map(int, input().split())
    V = set()

    @lru_cache(maxsize=None)
    def search(now):
        if now == 0:
            return 0

        ret = INF
        for div, cost in zip((2, 3, 5), (A, B, C)):
            q, r = divmod(now, div)
            ret = min(
                ret,
                search(q) + cost + r * D,
                search(q + 1) + cost + (div - r) * D if q + 1 < now else INF,
                now * D
            )
        return ret

    print(search(N))
s = input()
x = []
for c in s:
  if c == 'B':
    x.pop()
  else:
    x.append(c)
answer = ''.join(x)
print(answer)

### FIXED CODE ###

s = input()
x = []

for c in s:
  if c == 'B':
    if x:
      x.pop()
  else:
    x.append(c)
    
answer = ''.join(x)
print(answer)
zimport numpy
n = int(input())
l = []

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

if is_prime(n) :
    print(n-1)
if is_prime(n) == False:
    for i in range(2,int(numpy.sqrt(n))+1):
        if n%i == 0:
            a = i
            b = n//i
            l.append(a+b-2)
    print(min(l))

### FIXED CODE ###

import numpy
n = int(input())
l = []
ans = n

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

if is_prime(n) :
    print(n-1)
if is_prime(n) == False:
    for i in range(2,int(numpy.sqrt(n))+1):
        if n%i == 0:
            a = i
            b = n//i
            ans = min(n,a+b-2)
    print(ans)
class Union_find(object):
    def __init__(self, N):
        #親の番号を格納する。親だった場合は-(その集合のサイズ)
        self.parent = [-1]*(N)
    #Aがどのグループに属するか
    def root(self, A):
        if self.parent[A] < 0:
            return A
        else:
            #親を繋ぎ変えて高速化
            self.parent[A] = self.root(self.parent[A])
            return self.parent[A]
    def size(self, A):
        return -self.parent[self.root(A)]
    # A,Bをくっつける
    def connect(self, A, B):
        # A,Bを直接つなぐのでなく、root(A),root(B)をつなぐ
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        # 大きい方に小さい方をくっつける
        if self.size(A) < self.size(B):
            A, B = B, A
        self.parent[A] += self.parent[B]
        self.parent[B] = A
        return True

N, M = list(map(int, input().split()))
A = []
B = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    A.append(a-1)
    B.append(b-1)
uni = Union_find(N)
result = []
unconv = int(N*(N-1)/2)
for a, b in zip(reversed(A), reversed(B)):
    result.append(unconv)
    size_a = uni.size(a)
    size_b = uni.size(b)
    if uni.connect(a, b):
        unconv -= size_a*size_b
for r in reversed(result):
    print(r)


### FIXED CODE ###

A, B, C = list(map(int, input().split()))
max_i = B//A
print(min(max_i, C))
N=int(input())
print(len(set([input() for n in range(N)])))

### FIXED CODE ###

print('2018'+input()[4:])
import numpy as np
X = int(input())
Y = int(input())

temp = np.random.randint(1,10^18)
temp2 = 0
temp3 = 1
while not temp % X == 0 and temp % Y != 0:
    temp = np.random.randint(1,10^18)
    temp2 = temp2 + 1
    if temp2 == 1000000:
        temp3 = -1 
        break

if temp3 == -1:
    print(temp3)
else:
    print(temp)

### FIXED CODE ###

temp = input()
temp2 = temp.split(" ")
temp = []
for i in temp2:
    temp.append(int(i))

for i in range(1,100000000):
    ans1 = temp[0]*i
    if ans1 % temp[1] != 0:
        break
    if ans1 >= 10^18:
        ans1 = -1
        break
print(ans1)
a,b=map(str,input().split())
List = ["A","B","C","D","F"]
if a == b:
  print("=")
c = 0
d = 0
for i in range(6):
  if a == List[i]:
    c = i
  if b == List[i]:
    d = i
if c < d:
  print("<")
elif d < c:
  print(">")

### FIXED CODE ###

a,b=map(str,input().split())
List = ["A","B","C","D","E","F"]
if a == b:
  print("=")
c = 0
d = 0
for i in range(6):
  if a == List[i]:
    c = i
  if b == List[i]:
    d = i
if c < d:
  print("<")
elif d < c:
  print(">")
n=int(input())
s=[i for i in range(3)]
cnt=0
for j in range(n):
  cnt+=len(set(s[0][j],s[1][j],s[2][j])-1
print(cnt)

### FIXED CODE ###

n=int(input())
s=[list(input()) for _ in range(3)]
cnt=0
for i in range(n):
  cnt+=len(set([s[0][i],s[1][i],s[2][i]]))-1
print(cnt)
N, M = map(int, input().split())
P = map(int, input().split())

parent = list(range(N))
rank = [0] * N
key = [[i] for i in range(N)]
val = [[p-1] for p in P]

# union-find
def getRoot(x):
  p = parent[x]
  if p == x:
    return p
  ret = getRoot(p)
  parent[x] = ret
  return ret

def join(x, y):
  rx = getRoot(x)
  ry = getRoot(y)
  if rank[rx] < rank[ry]:
    parent[rx] = ry
    key[ry] += key[rx]
    val[ry] += val[rx]
  else:
    parent[y] = x
    key[rx] += key[ry]
    val[rx] += val[ry]
    if rank[rx] == rank[ry]:
      rank[rx] += 1

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

ans = 0
for i in range(N):
  if parent[i] == i:
    ans += len(set(key[i]).intersection(set(val[i])))

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
P = list(map(int, input().split()))

parent = list(range(N))
rank = [0] * N

idx = [None] * N
for i in range(N):
  idx[P[i]-1] = i

# union-find
def getRoot(x):
  p = parent[x]
  if p == x:
    return p
  ret = getRoot(p)
  parent[x] = ret
  return ret

def join(x, y):
  rx = getRoot(x)
  ry = getRoot(y)
  if rank[rx] < rank[ry]:
    parent[rx] = ry
  else:
    parent[ry] = rx
    if rank[rx] == rank[ry]:
      rank[rx] += 1

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

ans = 0
for i in range(N):
  if getRoot(i) == getRoot(idx[i]):
    ans += 1

print(ans)
P=int(input())
Q=int(input())
R=int(input())

a=[P+Q,Q+R,R+P]

print("{}".format(min(a))



### FIXED CODE ###

P, Q,R = map(int, input().split())
print("{}".format(min([P+Q,Q+R,R+P])))
x, y = map(int, raw_input().split())
if x < y:
    x, y = y, x

while y != 0
    x, y = y, x%y
print x

### FIXED CODE ###

# coding; utf-8

a, b = map(int, raw_input().split())
if a < b:
    a, b = b, a
while b != 0:
    a, b = b, a % b

print a
x = int(input())
def sanjo(x):
    return x**3

print(sanjo(x))\n

### FIXED CODE ###

x = int(input())
def sanjo(x):
    return x**3

print(sanjo(x))
X,t =map(int, split())
if X-t <0:
    print(str(0))
else:
    print(str(X-t))

### FIXED CODE ###

X,t = map(int, input().split())
if X-t<0:
    print(str(0))
else:
    print(str(X-t))
H,N = list(map(int,input().split))
A = list(map(int,input().split))
s = A[0]
for i in range(1,len(A)):
    s += A[i]
if s>=H:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

H,N = list(map(int,input().split()))
A = list(map(int,input().split()))
s = A[0]
for i in range(1,len(A)):
    s += A[i]
if s>=H:
    print("Yes")
else:
    print("No")
K = int(input())
S = str(input())

if K >= S:
  print(S)
else:
  print(S[:K] + '...')

### FIXED CODE ###

K = int(input())
S = str(input())
 
if K >= len(S):
  print(S)
else:
  print(S[:K] + '...')
from itertools import product

n = int(input())

d = {}
for i in range(n):
  a = int(input())
  for _ in range(a):
    x, y = map(int, input().split())
    if i + 1 not in d:
      d[i + 1] = []
    d[i + 1].append((x, y))

ret = 0
for x in product((0, 1), repeat=n):
  tmp = [-1] * n
  ok = True
  for i in range(n):
    if x[i] == 1:
      for y in d[i + 1]:
        if tmp[y[0] - 1] == -1:
          tmp[y[0] - 1] = y[1]
        elif tmp[y[0] - 1] != y[1]:
          ok = False
          break
    if not ok:
      break
  if ok and all(a == b or b == -1 for a, b in zip(x, tmp)):
    ret = max(ret, sum(x))

print(ret)

### FIXED CODE ###

from itertools import product

n = int(input())

d = {}
for i in range(n):
  a = int(input())
  for _ in range(a):
    x, y = map(int, input().split())
    if i + 1 not in d:
      d[i + 1] = []
    d[i + 1].append((x, y))

ret = 0
for x in product((0, 1), repeat=n):
  tmp = [-1] * n
  ok = True
  for i in range(n):
    if x[i] == 1 and i + 1 in d:
      for y in d[i + 1]:
        if tmp[y[0] - 1] == -1:
          tmp[y[0] - 1] = y[1]
        elif tmp[y[0] - 1] != y[1]:
          ok = False
          break
    if not ok:
      break
  if ok and all(a == b or b == -1 for a, b in zip(x, tmp)):
    ret = max(ret, sum(x))

print(ret)
L,R = map(int,input().split())
 
if R - L >=2019:
  print(0)
else:
  ans = 2019
  for i in range(L,R-1):
    for j in range(i+1,R):
    ans = min(ans,(i*j)%2019)
  print(ans)

### FIXED CODE ###

L,R = map(int,input().split())
ans = float('inf')
for i in range(L,R):
  for j in range(i+1,R+1):
    if (i*j)%2019==0:
      print(0)
      exit()
    ans = min(ans,(i*j)%2019)
print(ans)
n = int(input())
a = (int(x) for x in input().split())
for num in a:
  if num%2 = 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

### FIXED CODE ###

n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
def main():
    list = [int(x) for x in input().split()]

    sum = x[0] + x[1] + x[2]
    max = x[0]
    if max <= x[1]:
        max = x[1]
    if max <= x[2]:
        max = x[2]

    if max * 2 == sum:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    a, b, c = map(int, input().split() )

    if a == b + c or  b == c + a or c == a + b:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
n = input()
a = list(map(int, input().split()))
ans_dict = {}
for X in range(min(a), max(a)):
    ans_dict[str(X)] = 0
    for j in a:
        if X == j or X == j-1 or X == j+1:
            ans_dict[str(X)] = ans_dict[str(X)]+1
print(max(ans_dict.values()))

### FIXED CODE ###

n = input()
a = list(map(int, input().split()))
cnt=[0]*(10**5+2)
for i in a:
    cnt[i-1]+=1
    cnt[i]+=1
    cnt[i+1]+=1
print(max(cnt))
N, M = map(int, input().split())
sc = [list(map(int,input().split())) for i in range(M)]

sc = list(map(list, set(map(tuple, A))))
for i in range(len(sc)):
    tmp0 = sc[i][0]
    tmp1 = sc[i][1]
    for j in range(1, len(sc)-i+1):
        if tmp0 == sc[-j][0] and tmp1 != sc[-j][1]:
            print(-1)
            exit()

if N == 3:
    #for i in range(100,1000):
        #i_str = str(i)
    for j in range(len(sc)):
        if sc[j][0] == 1 and sc[j][0] == 0:
            print(-1)
            exit()
        if sc[j][0] == 1:
            num = sc[j][1]
print(-1)

### FIXED CODE ###

N, M = map(int, input().split())
P = [list(map(int,input().split())) for i in range(M)]

ans = -1

for x in range(1000):
    if len(str(x)) != N: 
        continue
    else:
        count = 0
        s = str(x)
        for p in P:
            if int(s[int(p[0]) - 1]) == p[1]:
                count += 1
        if count == M:
            ans = x
            break

print(ans)
LIM=200002
L=[0]*LIM

def bin_sum(Y):
    S=bin(Y)[2:]
    count=0
    for i in range(len(S)):
        count+=int(S[i])
    return count

def bin_sum2(Y):
    count=0
    for i in range(len(Y)):
        count+=int(Y[i])
    return count

for i in range(1,LIM):
    L[i]+=bin_sum(i)

def pop_num(N,b,L):
    if N==0:
        return 0
    v=N%b
    return pop_num(v,L[v],L)+1
    
M=[0]*200002
for i in range(1,200002):
    M[i]+=pop_num(i,L[i],L)
X=int(input())
Y=input()
d=bin_sum2(Y)+1
c=bin_sum2(Y)-1
e=int(Y,2)%d
f=int(Y,2)%c
for i in range(X):
    if Y[i]=="0":
        g=e+2**(X-1-i)%d
    else:
        g=e-2**(X-1-i)%c
    if g==0:
        print(0)
    else:
        print(M[g])

### FIXED CODE ###

from collections import deque
LIM=200004
L=[0]*LIM

def bin_sum(Y):
    S=bin(Y)[2:]
    count=0
    for i in range(len(S)):
        count+=int(S[i])
    return count

def bin_sum2(Y):
    count=0
    for i in range(len(Y)):
        count+=int(Y[i])
    return count

for i in range(1,LIM):
    L[i]+=bin_sum(i)

def pop_num(N,b,L):
    if N==0:
        return 0
    v=N%b
    return pop_num(v,L[v],L)+1
    
M=[0]*200005
for i in range(1,200004):
    M[i]+=pop_num(i,L[i],L)
X=int(input())
Y=input()
d=bin_sum2(Y)
e=int(Y,2)%(d+1)
f=int(Y,2)%max(1,(d-1))
O=[1]*(X+2)
P=[1]*(X+2)
q=max(d-1,1)
for i in range(1,X+1):
    O[i]=O[i-1]*2%q
    P[i]=P[i-1]*2%(d+1)
for i in range(X):
    
    if int(Y[i])==1:
        b=max(d-1,1)
        flag=max(0,d-1)
        g=(f-O[X-1-i]+b)%b
    else:
        b=d+1
        flag=1
        g=(e+P[X-1-i])%b

    if flag==0:
        print(0)
    elif g==0:
        print(1)
    else:
        print(M[g]+1)
N, M = map(int, input().split())
Edge = [[]for _ in range(N)]
Far = [-1]*N
for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    Edge[x].append(y)


def long(x):
    if len(Edge[x]) == 0:
        Far[x] = 0
        return 0
    if Far[x] >= 0:
        return Far[x]
    r = 0
    for i in Edge[x]:
        l = long(i) + 1
        r = max(r, l)
    Far[x] = r
    return r



for i in range(N):
    long(i)
print(max(Far))




### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = map(int, input().split())
Edge = [[]for _ in range(N)]
Far = [-1]*N
for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    Edge[x].append(y)


def long(x):
    if len(Edge[x]) == 0:
        Far[x] = 0
        return 0
    if Far[x] >= 0:
        return Far[x]
    r = 0
    for i in Edge[x]:
        l = long(i) + 1
        r = max(r, l)
    Far[x] = r
    return r


for i in range(N):
    long(i)
print(max(Far))
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
    if (x1-x2)*(x3-x4)+(y1-y2)*(y3-y4) == 0:
        print("YES")
    else:
        print("NO")
a = int(input())
for i in range(a):
    f = input().split()
    try:
        x1=f[0]
        y1=f[1]
        x2=f[2]
        y2=f[3]
        x3=f[4]
        y3=[f5]
        x4=f[6]
        y4=f[7]
    naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
except:
    print("NO")

    

### FIXED CODE ###

n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print("YES" if abs((y2-y1)*(x4-x3)-(x2-x1)*(y4-y3)) < 1e-10 else "NO")
N=int(input())
S=input()
 
print(s.count('ABC'))

### FIXED CODE ###

n=int(input())
s=input()
 
print(s.count('ABC'))
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
   print(a)
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

### FIXED CODE ###

N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)
A,B,K=map(int,input().split())
if A>=K:
  print (A-K, B)
elif A+B>=K:
  print(0, B+A-K)
else:
  print(O, O)

### FIXED CODE ###

A,B,K=map(int,input().split())
if A>=K:
  print (A-K, B)
elif A+B>=K:
  print(0, B+A-K)
else:
  print(0, 0)
#ABC153B
h,n = map(int,input().split())
a = list(map(int,inout().split()))
print("Yes" if sum(a) >= h else "No")

### FIXED CODE ###

#ABC153B
h,n = map(int,input().split())
a = list(map(int,input().split()))
print("Yes" if sum(a) >= h else "No")
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
????  for j in range(6):
????????????  if max <= price[j] - price[i]:
????????????????????  print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V)
        
cook(N, V)

### FIXED CODE ###

N = int(input())
v = list(map(float, input().split()))

v.sort()

r = v[0]

for i in v[1::]:
    r = (r + i) / 2

print(r)
m,n=map(int,raw_input().split())
if m==n==0:
    break
L=[]
s=range(1,m+1)
for i in range(1,n+1):
    if i%15==0:
        L.append("FizzBuzz")
    elif i%5==0:
        L.append("Buzz")
    elif i%3==0:
        L.append("Fizz")
    else:
        L.append(str(i))

j=0
for chars in L:
    t=raw_input()
    if t<>chars:
        del s[j%m]
    j+=1
print " ".join([str(i) for i in s])

### FIXED CODE ###

def Judge(i):
    if i%15==0: return "FizzBuzz"
    if i%5==0:  return "Buzz"
    if i%3==0:  return "Fizz"
    return str(i)

while True:
    m,n=map(int,raw_input().split())
    if m==n==0:break
    L=range(1,m+1)
    j=0
    for i in range(1,n+1):
        c=raw_input()
	if len(L)>1:
            if Judge(i)!=c:
                del L[j]
                j%=len(L)
            else:
                j=(j+1)%len(L)
    print " ".join(map(str,L))
N = str(input())

if int(N[1:]) % (9 * int('1' * len(N))) == 0:
    print(int(N[0] + 9 * (len(N)-1)))
else:
    print(int(N[0]) - 1 + 9 + 9 * len(N[2:]))



### FIXED CODE ###

N = str(input())

for item in N[1:]:
    if item != '9':
        print(int(N[0]) - 1 + 9 * (len(N) - 1))
        break
else:
    print(int(N[0]) + 9 * len(N[1:]))
import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

N, Q = map(int, input().split())
C = list(map(int, input().split()))

by_R = [[] for _ in range(N+2)]
for i in range(Q):
	l, r = map(lambda s: int(s)-1, input().split())
	by_R[r+1].append((l, i))

s = [0] * N
def update(pos, dif):
	while pos < N:
		s[pos] += dif
		pos |= pos + 1

def query(pos):
	res = 0
	while pos > 0:
		res += s[pos-1]
		pos &= pos - 1
	return res

diff = 0
ans = [-1] * Q
last = [-1] * N

for i, v in enumerate(C):
	if last[v] != -1:
		update(last[v], -1)
	else:
		diff += 1

	update(i, 1)
	last[v] = i

	for l, j in by_R[i+1]:
		ans[j] = diff - query(l)

print('\n'.join(map(str, ans)))


### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

N, Q = map(int, input().split())
C = list(map(int, input().split()))

by_R = [[] for _ in range(N+1)]
for i in range(Q):
	l, r = map(lambda s: int(s)-1, input().split())
	by_R[r+1].append((l, i))

s = [0] * N
def update(pos, dif):
	while pos < N:
		s[pos] += dif
		pos |= pos + 1

def query(pos):
	res = 0
	while pos > 0:
		res += s[pos-1]
		pos &= pos - 1
	return res

diff = 0
ans = [-1] * Q
last = [-1] * (N+1)

for i, v in enumerate(C):
	if last[v] != -1:
		update(last[v], -1)
	else:
		diff += 1

	update(i, 1)
	last[v] = i

	for l, j in by_R[i+1]:
		ans[j] = diff - query(l)

print('\n'.join(map(str, ans)))
N = int(input())
b = list(map(int, input().split()))

b_order = [-1]*N

def f():
    
    for i in range(N,0,-1):
        i_order = N - (i - b[i-1])

        while b_order[i_order - 1] != -1:
            i_order -= 1
            if i_order < 0:
                print(-1)
                return

        b_order[i_order - 1] = b[i-1]

    for i in b_order:
        print(i)

f()

### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))

res = []
for i in range(N):
    for j in range(N-i-1, -1, -1):
        if B[j] == j+1:
            res.append(j+1)
            B = B[:j]+B[j+1:]
            break
    else:
        break

if len(res) == N:
    res.reverse()
    for r in res:
        print(r)
else:
    print(-1)