peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a=input()
b=(a[-1])
if b == "3":
  print(a+"bon")
elif b == "0" or b =="1" or b =="6" or b =="8":
  print(a+"pon")
else :
  print(a+"hon")
# Judge status: Wrong Answer
n = int(input())

ans = (n // 11) * 2

rem = n % 11
if rem > 0 :
    if rem <= 5:
        ans += 1
    else:
        ans += 2

print(ans)
# Judge status: Accepted
N,M,K = map(int,input().split())

for row in range(N+1):
    for colum in range(M+1):
        black = row * M
        black -= row * colum
        black += (N - row) * colum
        if black == K:
            print("Yes")
            exit()

print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(0,n):
  if a[i]>a[i-1]:
    continue
  else:
    b.append(a[i-1]-a[i])
    
print(sum(b))
# Judge status: Accepted
N = int(input())
A =[]
max = 0
next = 0
for _ in range(N):
    a = int(input())
    A.append(a)
    if a > max:
        next = max 
        max = a
    elif a > next:
        next = a
for a in A:
    if a == max:
        print(next)
    else:
        print(max)
# Judge status: Wrong Answer
# 入力 : 数字3つ
a, b, c = map(int, input().split())

# 整数 C が A 以上 かつ B 以下であるかを判定してください。
if a <= c and c <= b :
    print("YES")
else :
    print("NO")
# Judge status: Wrong Answer
n = input()

if n[-1] == '3':
    print('bon')
elif n[-1] == '0' or '1' or '6' or '8' :
    print('pon')
else :
    print('hon')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print("0")
    exit()

m = a[0]
over = False
limit = pow(10, 18)
for i in a[1:]:
    m *= i
    if m > limit:
        over = True
        break

if over:
    print("-1")
else:
    print(m)
# Judge status: Accepted
import  math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N,X=map(int,input().split())
x=sorted(list((map(int,input().split()))))
y=[abs(i-X) for i in x ]
print(gcd_list(y))
# Judge status: Wrong Answer
li = input().split()
count = 0
for i in li:
    if i == "1":
        count += 1

print(count)
# Judge status: Accepted
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]
correct = [0] * N
for i in range(Q):
    correct[A[i] - 1] += 1

for i in range(N):
    if K - Q + correct[i] >= 1:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
a,b,m = map(int,input().split())

a = list(map(int,input().split()))
b = list(map(int,input().split()))

xyc = [ list(map(int,input().split())) for _ in range(m) ]

ma = min(a)
mb = min(b)

cost = ma + mb

for i in range(m):
    x = xyc[i][0]
    y = xyc[i][1]
    c = xyc[i][2]
    cost = min( cost, a[x-1] + b[y-1] - c )

print(cost)
# Judge status: Accepted
X = int(input())
ans = {1}
for i in range(2, 40):
    y = 2
    while i ** y <= X:
        ans.add(i ** y)
        y += 1
print(sorted(list(ans))[-1])
# Judge status: Accepted
s = input()
t = input()
ans = 1001001001
for i in range(len(s) - len(t) + 1):
    cnt = 0
    for j in range(len(t)):
        if s[i + j] != t[j]:
            cnt += 1
    if cnt <= ans:
        ans = cnt
print(ans)
# Judge status: Wrong Answer
a = list(input())
s = 0
for i in a:
    s += int(i)
print("+".join(a) + "=" + str(s))
# Judge status: Accepted
s = input().strip()
s = s[::-1]
r = 0
b = 0
N = len(s)
dp1 = [0] * (N+1)
dp2 = [0] * (N+1)
dp1[1] = int(s[0])
dp2[1] = 11 - int(s[0])
for i, c in enumerate(s[1:]):
    i += 1
    c = int(c)
    dp1[i+1] = min(dp1[i] + c, dp2[i] + c)
    dp2[i+1] = min(dp1[i] + 11 - c, dp2[i] + 9 - c)
#print(dp1)
#print(dp2)

print(min(dp1[-1], dp2[-1]))
# Judge status: Wrong Answer
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort(reverse=True)
total = sum(S)
while total % 10 == 0 and S:
    s = S.pop()
    total -= s
print(total)
# Judge status: Accepted
# 4
# https://atcoder.jp/contests/agc024/tasks/agc024_a
A,B,C,K=map(int,input().split())
K%=2
p=A-B
p*=(-1)**K
print(p if p<=10**18 else 'Unfair')
# Judge status: Accepted
c=input()
print('vowel' if c in 'aiueo' else 'consonant')
# Judge status: Accepted
N=int(input())
mod=10**9+7
print((pow(10,N,mod)-pow(9,N,mod)*2+pow(8,N,mod))%mod)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
[print("U",end="") for i in range(ty-sy)]
[print("R",end="") for i in range(tx-sx)]
[print("D",end="") for i in range(ty-sy)]
[print("L",end="") for i in range(tx-sx+1)]
[print("U",end="") for i in range(ty-sy+1)]
[print("R",end="") for i in range(tx-sx+1)]
print("D",end="")
print("R",end="")
[print("D",end="") for i in range(ty-sy+1)]
[print("L",end="") for i in range(tx-sx+1)]
print("U")
# Judge status: Wrong Answer
n,k=map(int,input().split())
A=list(map(int,input().split()))

C=[]
c=0
mina=min(A)
for i in range(len(A)):
    if mina==A[i]:
        C.append(c)
        c=0
    else:
        c+=1
C.append(c)

ans=0
for i in range(len(C)):
    ans += (C[i]+k-2)//(k-1)
ans = min(ans, (n+k-2)//(k-1))
print(ans)
# Judge status: Wrong Answer
n = int(input())
p = input().split()

cnt = 0
for i in range(0, n-2):
    print(p[i])
    if (p[i] < p[i+1] < p[i+2]) or (p[i] > p[i+1] > p[i+2]):
        cnt += 1
print(cnt)
# Judge status: Accepted
Q,H,S,D=map(int,input().split())
N=int(input())
litre=min(4*Q,2*H,S)
Litre=min(2*litre,D)
if N%2==0:
  print(Litre*(N//2))
else:
  print(Litre*(N//2)+litre)
# Judge status: Accepted
a = list(map(int,input().split()))

x = a[0]*60 + a[1]
y = a[2]*60 + a[3]

z = y - x

r = z - a[4]

print(r)
# Judge status: Wrong Answer
print(int(360 / (180 - int(input()))))
# Judge status: Accepted
import math
n=int(input())
i=1
k=0
ans=0
while True:
    zan=n-3*i
    if zan<0:
        break
    ans+=math.factorial(zan+k)//(math.factorial(zan)*math.factorial(k))
    i+=1
    k+=1
print(ans%(10**9+7))
# Judge status: Accepted
n=int(input())
a=0
h=0
for i in range(n):
    x,y=map(int,input().split())
    if x==y:
        a=a+1
    else:
        a=0
    if a==3:
        h=1
if h==1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S = input()

ans={'hi','hihi','hihihi','hihihihi','hihihihihi'}

for i in ans:
    if i == S:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=list(map(int,input().split()))

d={}

for x in range(n):
  if a[x] not in d:
    d[a[x]]=0
  d[a[x]]+=1
  
ans=0
ans1=[]
for g in d:
  ans1.append(d[g])
  
if len(ans1)<k:
  print(k)
  
else:
  ans1.sort()
  r=len(ans1)-k
  for t in range(r):
    ans+=ans1[t]
    
  print(ans)
# Judge status: Accepted

print(len([str(i) for i in range(1, int(input())+1) if len(str(i)) % 2 == 1]))
# Judge status: Accepted
N = int(input())
s = [int(input()) for _ in range(N)]
if sum(s) % 10 != 0: print(sum(s)); exit()
else:
  s.sort()
  for i in range(N):
    if (sum(s)-s[i])%10 != 0: print(sum(s)-s[i]); exit()
print(0)
# Judge status: Wrong Answer
x,y = map(int,input().split())

if y % x == 0:
    print(-1)
else:
    print(x)
# Judge status: Accepted
import math


def main():
    N, M = list(map(int, input().split(' ')))
    if N >= M // 2:
        print(M // 2)
    else:
        t = math.ceil(((M // 2) - N) / 2)
        print((M - 2 * t) // 2)



if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
a=int(input())
b=list(map(int,input().split()))
c=b.count(0)
if c>0:
    print('0')
    sys.exit()
ans=1
for i in range(a):
  ans=ans*b[i-1]
  if ans>10**18:
      print('-1')
      sys.exit()
      
print(ans)
# Judge status: Accepted
s, c = map(int, input().split())

cnt = 0
if s <= c // 2: 
    cnt += s
    c -= 2 * s
    s = 0
else:
    cnt += c // 2
    s -= c // 2
    c = 0

cnt += c // 4

print(cnt)
# Judge status: Wrong Answer
n,m=map(int,input().split())
x=sorted(list(map(int,input().split())))
if m<=n:
  print(0)
else:
  d=[]
  for i in range(m-1):
    d.append(x[i+1]-x[i])
  d=sorted(d)
  print(sum(d[:n+1]))
# Judge status: Accepted
n=int(input())
a=list(map(lambda x:min(int(x)//400,8),input().split()))
cat=[0]*8
f=0
for ai in a:
    if ai < 8:
        cat[ai]=1
    if ai == 8:
        f+=1
print(str(max(sum(cat),1))+' '+str(sum(cat)+f))
# Judge status: Accepted
A,B,M=map(int,input().split())
a_1=list(map(int,input().split()))
b_1=list(map(int,input().split()))
L=[list(map(int,input().split())) for _ in range(M)]

count=[]
count.append(min(a_1)+min(b_1))

for k in range(M):
    count.append(a_1[L[k][0]-1]+b_1[L[k][1]-1]-L[k][2])

print(min(count))
# Judge status: Accepted
def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    N, K = mi()
    D = set(mi())
    while True:
        if set(map(int, str(N))) & D:
            N += 1
        else:
            print(N)
            return
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = str(input())
L = [753]
for i in range(len(s) - 2):
  a = int(s[i:i + 3])
  L.append(a)
L.sort()
print(L)
for j in range(len(L)):
  if L[j] == 753:
    if j == len(L) - 1:
      print(L[j] - L[j - 1])
      break
    if j == 0:
      print(L[j + 1] - L[j])
      break
    else:
      if L[j + 1] - L[j] <= L[j] - L[j - 1]:
        print(L[j + 1] - L[j])
      else:
        print(L[j] - L[j - 1])
      break
# Judge status: Accepted
s = input()
t = input()

sc = {}
tc = {}

for i in range(len(s)):
    if s[i] in sc:
        sc[s[i]].append(i)
    else:
        sc[s[i]] = [i]

    if t[i] in tc:
        tc[t[i]].append(i)
    else:
        tc[t[i]] = [i]

sc = list(sc.values())
tc = list(tc.values())

print("Yes" if sc == tc else "No")
# Judge status: Wrong Answer
import bisect
import numpy as np
n = int(input())
a = sorted(list(map(int,input().split())))
b = sorted(list(map(int,input().split())))
c = sorted(list(map(int,input().split())))

memo = [0] * n
for i in range(n):
     memo[i] = n - bisect.bisect_right(c,b[i])
memo.reverse()
memo1 = np.cumsum(memo)

ans = 0
for i in range(n):
     if a[i] > b[n-1]:
          continue
     else:
          ans += memo1[n-1-bisect.bisect_right(b,a[i])]
print(ans)
# Judge status: Accepted
s = list(str(input()))
s1 = list(set(s))

print('yes' if len(s)==len(s1) else 'no')
# Judge status: Accepted
n = int(input())
X = []
Y = []
for i in range(n):
  x, y = map(int, input().split())
  X.append(x)
  Y.append(y)

def length(a, b):
  return ((X[a]-X[b])**2 + (Y[a]-Y[b])**2)**0.5
def total_len(L):
  n = len(L)
  total = 0
  for i in range(n-1):
    total += length(L[i], L[i+1])
  return total

from itertools import permutations as prm
import math
s = 0
for i in prm(list(range(0, n)), n):
  s += total_len(i)
print(s / math.factorial(n))
# Judge status: Accepted
from collections import Counter

N = int(input())
C = Counter(input())

for n in range(N-1):
    C&=Counter(input())

print(*sorted(C.elements()),sep="")
# Judge status: Accepted
################ C
n = int(input())
nums = list(map(int, input().split()))

total = 0
total_sum = sum(nums)
for num in nums:
    total_sum -= num 
    total += num * total_sum
    
print(total % 1000000007)
# Judge status: Accepted
import collections


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    counter = collections.Counter(A)
    ans = 0

    for i in counter.values():
        ans += i * (i - 1) // 2

    for a in A:
        count = counter[a]
        print(ans - (count * (count - 1) // 2) +
              ((count - 1) * (count - 2) // 2))


resolve()
# Judge status: Wrong Answer
N = int(input())
if N%2 == 0:
    print(N/2)
else:
    print(N/2+1)
# Judge status: Accepted
X, Y = map(int,input().split())
print(X+Y//2)
# Judge status: Accepted
d, n = map(int, input().split())
if n < 100: print(n * (100 ** d))
else: print((n + 1) * (100 ** d))
# Judge status: Wrong Answer
import math
n,m = map(int,input().split())
if abs(n-m) > 1:
  print(0)
elif n == m:
  print((math.factorial(n)**2)*2 % 1000000007)
else:
  print(math.factorial(max(n,m))*math.factorial(min(n,m)) % 100000007)
# Judge status: Wrong Answer
import numpy as np

def yn(t,x):
  for j in range(len(t)-1):
    if t[j+1] < x:
      return False
  return True
  

n,m,x=list(map(int,input().split()))
a=[]
for i in range(n):
  a.append(list(map(int,input().split())))
  
a=np.array(a)
a=a[np.argsort(a[:,0])]
t=np.sum(a,axis=0)

for i in range(1,n+1):
  if yn(t-a[-i],x):
    t = t-a[-i]

if not yn(t,x):
  print("-1")
else:
  print(t[0])
# Judge status: Wrong Answer
from collections import deque

n = int(input())
friendly = list(map(int, input().split()))
friendly.sort(reverse=True)

confort = 0

edge = []

for i in range(n):
    if i == 0:
        continue
    elif i == 1:
        confort += friendly[0]
        edge.append(friendly[1])
        edge.append(friendly[1])
    else:
        max_edge = friendly[i-1]
        confort += max_edge
        edge.insert(edge.index(max_edge), friendly[i])
        edge.insert(edge.index(max_edge) + 1, friendly[i])
        
print(confort)
# Judge status: Wrong Answer
s = input()

ans = 0
for idx in range(len(s)):
    if s[idx] in ['D', '?']:
        ans += 1
    elif s[idx] == 'P' and idx != len(s) - 1 and s[idx+1] == 'D':
        ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
A = [int(input()) for i in range(n)]
s = sum(A)
if s % 10:
	print(s)
else:
	A.sort()
	for a in A:
		if a % 10:
			print(s - a)
			exit()
	else:
		print(0)
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())

if N % 2 == 0:
    Min = min(N*Q*4, N*H*2, N*S, N//2*D)
else:
    Min = min((N-1)*Q*4, (N-1)*H*2, (N-1)*S, N//2*D) + min(4*Q, 2*H, S)
print(Min)
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
count = 0
for n in range(N):
  if B[n]>=A[n]:
    count+=A[n]
    if B[n]-A[n]>A[n+1]:
      count+=A[n+1]
      A[n+1]=0
    else:
      count+=B[n]-A[n]
      A[n+1]-=(B[n]-A[n])
  else:
    count+=B[n]
print(count)
# Judge status: Accepted
k = int(input())
a,b = map(int,input().split())

ans='NG'

for i in range(a,b+1):
  if i%k==0:
    ans='OK'
    break

print(ans)
# Judge status: Wrong Answer
N,M = map(int,input().split())
LR = [[int(x) for x in input().split()] for _ in range(M)]
L = 1
R = N
for l,r in LR:
  L = max(L,l)
  R = max(R,r)
  
if L > R:
  print(0)
else:
  print(R-L+1)
# Judge status: Wrong Answer
s = input()
o = [s[2 * i] for i in range(len(s) // 2)]
e = [s[2 * i + 1] for i in range(len(s) // 2)]
if "L" not in o and "R" not in e:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = [list(map(int, input().split())) for _ in range(2)]

ans = 0


for i in range(n):
    r = 0
    line = 0
    for j in range(n):
        r += a[line][j]
        if j==i:
            line = 1
            r += a[line][j]
    ans = max(ans, r)

print(ans)
# Judge status: Wrong Answer
N = int(input())
s = sorted([input() for i in range(N)])
M = int(input())
t = sorted([input() for i in range(M)])
a = 0
for i in range(N):
    for j in range(M):
        if a <= (s.count(s[i]) - t.count(t[j])):
            a = s.count(s[i]) - t.count(t[j])
print(a)
# Judge status: Wrong Answer
n = int(input())
X = sorted(list(map(int,input().split())))
Y = sorted(list(map(int,input().split())))
Z = sorted(list(map(int,input().split())))
print(sum(bisect.bisect_left(X,b) * (n-bisect.bisect_right(Z,b))) for b in Y)
# Judge status: Accepted
N, X, Y = map(int, input().split())
ans = [0] * N

for fr in range(1, N + 1):
    for to in range(fr + 1, N + 1):
        cost = min(to - fr, abs(X - fr) + abs(to - Y) + 1)
        ans[cost] += 1

print(*ans[1:], sep="\n")
# Judge status: Accepted
C = input()
S = "abcdefghijklmnopqrstuvwxyz"
 
for i in range(26):
  if C == S[i]:
    print(S[i+1])
    break
# Judge status: Accepted
n,k=map(int, input().split())
a_list=[int(i) for i in input().split()]

dic={}

for i in a_list:
    if i in dic:
        dic[i]+=1
    else:
        dic[i]=1

dic2=sorted(dic.items(), key=lambda x:x[1])

ans=0

if len(dic)>k:
    num=len(dic)-k
    for i in range(num):
        ans+=dic2[i][1]

    
print(ans)
# Judge status: Accepted
n=int(input())
s=list(input())
ans=[]
count=0
num=[]

for i in range(1,n+1):
  l=s[:i]
  r=s[i:]
  
  l=sorted(l)
  r=sorted(r)
  
  for j in l:
    if j in r:
      if j not in num:
        count+=1
        num.append(j)
        
  ans.append(count)
  num.clear()
  count=0
  
print(max(ans))
# Judge status: Accepted
n,l=map(int,input().split())
ans=float('inf')
for i in range(1,n+1):
  ans=min(ans,abs(l+i-1))
  
#print(ans)

s=(l*n+n*(n-1)//2)
if s<=0:
  print(s+ans)
  
else:
  print(s-ans)
# Judge status: Accepted
N = int(input())
N_o = int(N/1.08)
if int(N_o * 1.08) == N:
    print(N_o)
else:
    if int((N_o+1)*1.08) == N:
        print(N_o+1)
    elif  int((N_o-1)*1.08) == N:
        print(N_o-1)
    else:
        print(':(')
# Judge status: Wrong Answer
A,B = map(int,input().split())
max(A+A-1,A+B,B+B-1)
# Judge status: Accepted
def digit_sum(x):
    res = 0
    while x > 0:
        res += x % 10
        x //= 10
    return res


N = int(input())
ans = N
for i in range(1, N):
    A = i
    B = N - i
    ans = min(ans, digit_sum(A) + digit_sum(B))
print(ans)
# Judge status: Wrong Answer
x, a, b = map(int, input().split())

if b <= a:
  print('delicious')
elif b <= x:
  print('safe')
else:
  print('dangerous')
# Judge status: Accepted
Si = []
N = input()
for i in range(int(N)):
	Si.append(input())

C0 = Si.count('AC')
C1 = Si.count('WA')
C2 = Si.count('TLE')
C3 = Si.count('RE')

print('AC x', int(C0))
print('WA x', int(C1))
print('TLE x', int(C2))
print('RE x', int(C3))
# Judge status: Accepted
n = int(input())
P = list(map(int,input().split()))
cnt=0
for i in range(1,n-1):
    if P[i-1]<P[i]<P[i+1] or P[i-1]>P[i]>P[i+1]:
        cnt+=1
print(cnt)
# Judge status: Accepted
n, m = map(int, input().split())
sc = []
for i in range(m): sc.append(list(map(int, input().split())))

for i in range(10**n):
    flg = True
    if len(str(i)) == n:
        for j in sc:
            # print(int(str(i)[j[0]-1]))
            if int(str(i)[j[0]-1]) != j[1]:
                flg = False
        if flg:
            print(i)
            exit()
print(-1)
# Judge status: Wrong Answer
A, B, C = sorted([int(x) for x in input().strip().split()])
print(A * B * (C // 2))
# Judge status: Wrong Answer
N = int(input())
S = list(input())
ans = 0
for i in range(N):
    for j in range(i+1,N):
        if S[i] != S[j]:
            for k in range(j+1,N):
                if j-i != k-j and S[j] != S[k] and S[i] != S[k]:
                    ans += 1
                    print(S[i],S[j],S[k])
print(ans)
# Judge status: Accepted
n = int(input())
s = input()
countwhite = [0] * (n+1)
countblack = [0] * (n+1)

#whitecount
cnt = 0
for i in range(n):
    if s[i] == "#":
        cnt += 1
    countwhite[i+1] = cnt

cnt = 0
for i in range(n-1, -1, -1):
    if s[i] == ".":
        cnt += 1
    countblack[i] = cnt

#print(countwhite)
#print(countblack)
res = 999999999999999
for i in range(n+1):
    res = min(res, countblack[i] + countwhite[i])
print(res)
# Judge status: Accepted
s=input()

if s=="Sunny":
  print("Cloudy")
if s=="Cloudy":
  print("Rainy")
if s=="Rainy":
  print("Sunny")
# Judge status: Wrong Answer
import numpy as np
n = int(input())
aa = list(map(int, input().split()))
mod = 10**9+7
res = 1
pow2 = 1
ans = 0
for i in range(60):
    cnt = np.count_nonzero(np.array(aa)&2)
    ans = (ans + cnt * (n-cnt) * res)%mod
    res = (res*2)%mod
    pow2*=2
print(ans)
# Judge status: Accepted
import math
import calendar
import fractions
import itertools
from fractions import gcd
n = int(input())
t = [int(input()) for _ in range(n)]

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

print(lcm(t))
# Judge status: Accepted
n, k = map(int, input().split())
ans = [0]*n
for i in range(k):
    d = int(input())
    a_list = list(map(int, input().split()))
    for j in range(len(a_list)):
        ans[a_list[j]-1] += 1
print(ans.count(0))
# Judge status: Accepted
X,Y = map(int,input().split())
k = 0
while X*2**k<=Y:
    k += 1
print(k)
# Judge status: Accepted
N, K = map(int,input().rstrip().split())
if N%K==0:
    print(0)
else:
    print(1)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

point = 0
before = 10**10

for i in range(n):
    point += b[a[i]-1]
    if a[i] == before+1:
        point += c[a[i-1]-1]
    before = a[i]

print(point)
# Judge status: Accepted
N = int(input())
List = list(map(int,input().split()))
List2 = [0]*N
for i in range(N-1):
    List2[List[i-1]-1] += 1 
for j in List2:
    print(j)
# Judge status: Accepted
a = int(input())

s = input()

if a >= 3200:
    print(s)
else:
    print("red")
# Judge status: Accepted
import copy
import sys

s = input()
t = input()
li = list('abcdefghijklmnopqrstuvwxyz')
r = []
for i in range(len(s)-len(t)+1):
    ss = list(s)
#     print(i)
    lo = [1 if ((s[i + j] == t[j]) or (s[i + j] == '?')) else 0 for j in range(len(t))]
#     print(lo)
    if all(lo):
        ss[i:i+ len(t)] = t
        rs = ''.join(ss)
        rs = rs.replace('?','a')
        r += [rs]

if len(r) == 0:
    print('UNRESTORABLE')
    sys.exit()
r = sorted(r)
print(r[0])
# Judge status: Accepted
import math
l=10**9+7

n,a,b=map(int,input().split())
comb=[1]

for i in range(max(a,b)):
    den=i+1
    num=n-i
    ans=comb[i]*num*pow(den,l-2,l)%l
    comb.append(ans)


print((pow(2,n,l)-1-comb[a]-comb[b])%l)
# Judge status: Accepted
def readinput():
    n=int(input())
    p=list(map(int,input().split()))
    return n,p

def main(n,p):
    count=0
    pmin=p[0]
    for i in range(n):
        pmin=min(p[i],pmin)
        if pmin>=p[i]:
            count+=1
    return count

if __name__=='__main__':
    n,p=readinput()
    ans=main(n,p)
    print(ans)
# Judge status: Wrong Answer
import math
A, B, H, M = map(int, input().split())

H_deg = H*30 + M*0.5 if H < 6 else (H-12)*-1*30 - M*0.5
M_deg = M*6
if M <= H*5:
    degree = H_deg + M_deg
else:
    degree = M_deg - H_deg

if degree == 180:
    print(A+B)
elif degree < 180:
    c = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(degree)))
    print(c)
else:
    c = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(360-degree)))
    print(c)
# Judge status: Accepted
# coding: utf-8

abc = list(sorted(map(int ,input().rstrip().split(" "))))

if len([i for i in abc if i % 2 == 0]) > 0:
    print(0)
    exit(0)

red = abc[0] * abc[1] * int(abc[2]/2)
blue = abc[0] * abc[1] * (abc[2] - int(abc[2]/2))

print(abs(red-blue))
# Judge status: Accepted
A_list = list(map(int, input().split()))
s = sum(A_list)
if s >= 22:
    print("bust")
else:
    print("win")
# Judge status: Accepted
x,y=map(int,input().split())
if 0<=x<10 :
    z=100*(10-x)
    a=y+z
elif 10<=x :
    a=y
print(a)
# Judge status: Accepted
n=int(input())
y=n*800
x=n//15*200
print(y-x)
# Judge status: Wrong Answer
x, y=map(int, input().split())
import math
d=math.log2(y/x)
print(math.ceil(d))
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      x = a*500+b*100+c*50
      if x == X:
        ans += 1
        break
      elif x > X:
        break
        
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import math
a,b=map(int, input().split())
print(a*b//math.gcd(a,b))
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:
        ans += 1
print(ans)
# Judge status: Wrong Answer
k,a,b=map(int,input().split())
cnt=0
if b<a+2:
    print(k+1)
else:
    if k>=a+1:
        k-=a+1
        cnt+=b
        q,modulo=divmod(k,2)
        cnt+=q*b-q*a+modulo
        print(cnt)
    else:
        print(k)
# Judge status: Accepted
n,m = map(int, input().split())
h = list(map(int, input().split()))
path = [list(map(int, input().split())) for i in range(m)]

ans = [[i] for i in h]

for i in path:
    ans[i[0]-1].append(h[i[1]-1])
    ans[i[1]-1].append(h[i[0]-1])


count = 0
for i in ans:
    if len(i)==1:
      count += 1
    elif i[0] == max(i) and i.count(i[0])==1:
      count +=1
print(count)
# Judge status: Accepted
a,b,c = map(int, input().split())
d = 4 * a* b
e = (c-a-b)**2
if c-a-b < 0:
  print("No")
elif d < e:
  print("Yes")
else:
  print("No")