peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a=input()
b=input()
c=input()
n=a
while True:
  if n!="":
    k=n[0]
    if n==a:
      a=a[1:]
    elif k==b:
      b=b[1:]
    else:
      c=c[1:]
    if k=="a":
      n=a
    elif k=="b":
      n=b
    else:
      n=c
  else:
    if n==a:
      print("A")
    elif n==b:
      print("B")
    else:
      print("C")
    break
# Judge status: Accepted
S=input()
P=2019

mod_table=[0]*P
mod_table[0]=1

modp=0
mod10=1
for i in reversed(range(len(S))):
  si=int(S[i])
  modp=(si*mod10+modp)%P
  mod_table[modp]+=1
  mod10=(mod10*10)%P
  
answer=0
for m in mod_table:
  answer+=m*(m-1)//2
  
print(answer)
# Judge status: Wrong Answer
N = int(input())

array = []
cnt6 = 0
while 6**cnt6 < N:
    array.append(6**cnt6)
    cnt6 += 1
    
cnt9 = 0
while 9**cnt9 < N:
    array.append(9**cnt9)
    cnt9 += 1

a = sorted(list(set(array)))
# 最小
dp = [i for i in range(N+1)]
# print(dp)
n = 6
for n in a:
    for i in range(N+1):
        if i+n <= N:
            dp[i+n] = min(dp[i]+1, dp[i+n])
print(dp[N])
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-


def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))

    total = sum(h)

    if k >= n:
        print(0)
    elif k == 0:
        print(total)
    else:
        print(total - sum(sorted(h[k + 1:], reverse=True)))


if __name__ == '__main__':
    main()
# Judge status: Accepted
from functools import reduce


N = int(input())
A = list(map(int, input().split()))
base = reduce(lambda x, y: x ^ y, A)
print(*[base ^ A[i] for i in range(N)])
# Judge status: Wrong Answer
#DP B
import sys
N, K = map(int, sys.stdin.readline().split())
H = list(map(int, sys.stdin.readline().split()))

dp = [-1 for _ in range(N)]
#print(dp)
#print(H)
dp[1] = abs(H[1]-H[0])
#print(dp)

for i in range(2, N):
    for k in range(1, K+1):
        if i-k>=0:
            tmp = abs(H[i]-H[i-k]) + dp[i-k]
            if dp[i] ==-1 or tmp < dp[i]:
                dp[i] = tmp
    #print(dp)
print(dp[-1])
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
b=int(b)
if a>=12:
  print(b)
if 6<=a<12:
  print(int(b/2))
else:
  print("0")
# Judge status: Accepted
n ,m = map(int, input().split())
ln = []
lm = []

for i in range(n):
    ln.append(input())
for i in range(m):
    lm.append(input())

lim = n - m + 1
for i in range(lim):
    for j in range(lim):
        l = 0
        for k in ln[i:i+m]:
            if k[j:j+m] != lm[l]:
                break
            l += 1
        else:
            print("Yes")
            break
    else:
        continue
    break

else:
    print("No")
# Judge status: Accepted
import math

A, B = [int(i) for i in input().split()]

B2 = B - A
A2 = A - 1
print(math.ceil(B2 / A2) + 1)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
for i in range(a):
    for j in range(b):
        if i*b+j*a==c:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
list_s = list(input())
if len(list_s) == 3 and list_s.count('a') == 1 and list_s.count('b') == 1 and list_s.count('c') == 1 :
    print("Yes")
else:
    print('No')
# Judge status: Accepted
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(m):
    minimum=heapq.heappop(a)
    mini=((minimum*(-1))//2)*(-1)
    heapq.heappush(a,mini)
    
print(-sum(a))
# Judge status: Wrong Answer
import sys

n = int(input())

# 奇数始まりは必ず0
if n % 2 == 1:
    print(0)
    sys.exit()

# 5の因子を数える
# 5の倍数は10個ごと、25の倍数は50個ごと、125の倍数は250個ごとに登場する
ans = 0
cnt = 1
while 5**cnt * 2 < n:
    ans += n // (5**cnt * 2)
    cnt += 1
print(ans)
# Judge status: Wrong Answer
a = input()

cnt = 0

for c in a:
  cnt=cnt + 1
  
print(c)
# Judge status: Accepted
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

yes = "Yes"
no = "No"


def main():
    s = input()
    div = 0
    for tmp in s:
        i = int(tmp)
        div += i
        div %= 9
    if div == 0:
        print(yes)
    else:
        print(no)


main()
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
da=abs(x-a)
db=abs(x-b)
if da<db:
  print("A")
elif da>db:
  print("B")
# Judge status: Wrong Answer
import itertools

list_of_num = list(range(10))
inputs = input().split(' ')
n, k = int(inputs[0]), int(inputs[1])
[list_of_num.remove(int(i))for i in input().split(' ')]

if len(str(n)) == sum([1 for i in list(str(n)) if int(i) in list_of_num]):
    print(n)
else:
    list_of_num = [str(i) for i in list_of_num]

    answer = itertools.product(str(''.join(list_of_num)), repeat=10000)
    for j in answer:
        buf = int(''.join(j))
        if n < buf:
            print(buf)
            break
# Judge status: Wrong Answer
H, M, h, m, K = map(int, input().split())
print(((60*h + m - 60*H - M)//K - 1)*K)
# Judge status: Accepted
# -*- coding: utf-8 -*-

#----------
O = input().strip()
E = input().strip()
#----------

new_S=""
for i in range(1,len(O)+len(E)+1):
    if (i % 2) == 1:
        new_S += O[i // 2]
    else:
        new_S += E[i // 2 - 1]

print(new_S)
# Judge status: Wrong Answer
x = int(input())
print('YES' if x == 7 or 5 or 3 else 'NO')
# Judge status: Accepted
n = int(input())

ans = float("inf")
for a in range(1,n):
	b = n-a
	sa = str(a).rjust(6,"0")
	sb = str(b).rjust(6,"0")
	cnt = 0
	for i in range(6):
		cnt += int(sa[i]) + int(sb[i])

	ans = min(ans, cnt)

print(ans)
# Judge status: Wrong Answer
n, m = map(int,input().split())
p = [[i] + list(map(int,input().split())) for i in range(m)]
p = sorted(p, key=lambda x:(x[1], x[2]))
for i in range(m):
    p[i][1] = str(p[i][1]).zfill(6)
    p[i][2] = str(p[i][2]).zfill(6)
p = sorted(p, key=lambda x:(x[0]))
for i in range(m):
    print(p[i][1]+p[i][2])
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))
ans = 10**36
S = 0

for p in range(100):
    S =0
    for x in X:
        S += (x-p)**2
    ans = min(ans,S)

print(ans)
# Judge status: Wrong Answer
import sys; input = sys.stdin.readline
def main():
  S = input()
  Q = int(input())
  for i in range(Q):
    TFC = input().split()
    S = S[::-1] if TFC[0]=="1" else (TFC[2]+S if TFC[1]=="1" else S+TFC[2])
  print(S)

if __name__=="__main__":
  main()
# Judge status: Accepted
import collections
N = int(input())
D = list(map(int, input().split()))
d = collections.Counter(D)
maxnum = max(D)
ans = 1
for i in range(maxnum+1):
    if i == 0:
        if D[0] != 0 or d.get(0,0) != 1:
            ans = 0
            break
    else:
        if d.get(i, 0) == 0:
            ans = 0
            break
        ans *= d[i-1]**d[i]

print(ans%998244353)
# Judge status: Accepted
if int(input())%500 > int(input()):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
def main():
    n,l = map(int,input().split())
    a = [l+i-1 for i in range(1, n+1)]
    b = [abs(i) for i in a]
    m = min(b)
    i = b.index(m)
    del a[i]
    print(sum(a))
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
ans = a[1: 1+2*n:2]
#print(ans)
print(sum(ans))
# Judge status: Wrong Answer
s=input()
x=ord('a')
z=0
for i in range(x,x+27):
    y=chr(i)
    if y not in s:
        print(y)
        z=1
        break
if z==0:
    print('None')
# Judge status: Wrong Answer
n, m = map(int, input().split())
if n==m:
  print("AC")
else:
  print("WA")
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split(' ')))
rate = [0]*9
for a in A:
    c = min(a//400, 8)
    rate[c] += 1
count = 0
i = 0
while i < 8:
    if rate[i] != 0:
        count += 1
    i += 1
cmax = count+rate[8]
cmin = max(1, count)

print(str(cmin)+' '+str(cmax))
# Judge status: Accepted
k=int(input())
if k%2==0:
    print(((k//2)**2))
else:
    print(((k//2)+1)*(k//2))
# Judge status: Wrong Answer
N = int(input())
NR = int(N**0.5)
count = 0
if int(N/2)-N/2 == 0:
    for i in range(1,int(N/2)):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)
else:
    for i in range(1,int(N/2)+1):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)


print(count)
# Judge status: Wrong Answer
N, M = map(int,input().split())
P = [input().split() for i in range(N)]
P.sort()

j = 0
total = 0

for i in range(N):
  if (j + int(P[i][1])) < M:
    total += int(P[i][0]) * int(P[i][1])
    j += int(P[i][1])
  else:
    total += int(P[i][0]) * (M - j)
    break
print(total)
# Judge status: Accepted
a, b, n = map(int, input().split())

x = n
if n >= b-1:
    x = b-1

ans = (a*(x%b))//b
print(ans)
# Judge status: Accepted
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(x & -x, 4) for x in A]

CA = Counter(A)
num0 = CA[1]
num1 = CA[2]
num2 = CA[4]
if num1:
    num1 = 1
if num2 - (num1 + num0) >= -1:
    print("Yes")

else:
    print("No")
# Judge status: Wrong Answer
a,b,c =map(int,input().split() )
d = a + b + c
e = a * b * c
if(d == 17 and e == 175):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n, l = map(int, input().split())
ll = []
for i in range(n):
    ll.append(input())
print(ll)
ll.sort()
print(ll)
ans = ""
for j in ll:
    ans += j

print(ans)
# Judge status: Accepted
s=input()
rem = len(s)-7

if s[rem:] == 'keyence': 
    print('YES')
    exit()
for i in range(8):
    news = s[0:i] + s[i+rem:]
    if news == 'keyence':
        print('YES')
        break
else:
    print('NO')
# Judge status: Accepted
a,b,k = map(int, input().split())

if b-a+1 > 2*k:
  for i in range(a,a+k): print(i)
  for i in range(b-k+1,b+1): print(i)
else:  
  for i in range(a,b+1): print(i)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20

def main():
    N,M=mi()
    X = list(range(1,N+1))

    ans = 0
    for i in range(M):
        print(X[i],X[::-1][i])


if __name__ == "__main__":
    main()
# Judge status: Accepted
H,N=map(int,input().split())
A=[]
B=[]
for i in range(N):
   a,b=map(int,input().split())
   A.append(a)
   B.append(b)

DP=[[0]*(H+max(A)) for i in range(N)]
DP.insert(0,[10**8+1]*(H+max(A)))
DP[0][0]=0

for i in range(1,N+1):
   for j in range(1,H+max(A)):
      if j-A[i-1]>0:
         DP[i][j]=min(DP[i-1][j],DP[i][j-A[i-1]]+B[i-1])
      else:
         DP[i][j]=min(DP[i-1][j],B[i-1])

print(DP[N][H])
# Judge status: Wrong Answer
n=int(input())
a=list(input().split())
if n > 3:
    ans=''
    ans += ' '.join(a[::-2])
    print(a[::2])
    if n%2==0:
        ans += ' ' + ' '.join(a[0::2])
    else:
        ans += ' ' + ' '.join(a[1::2])
    print(ans)
else:
    ans=[]
    for i in range(n):
        ans.append(a[i])
        ans.reverse()
    print(' '.join(ans))
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


n = ri()
s = collections.Counter(rr())
print(min(s['0'], s['1']))
# Judge status: Accepted
x, y = map(int, input().split())

if x % y == 0:
    print(-1)
else:
    print(x * (y + 1))
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
if a[0]>x:
  ans+=a[0]-x
  a[0]=x
for i in range(n-1):
  if a[i]+a[i+1]>x:
    if a[i+1]>(x-a[i]):
      ans+=(a[i+1]-(x-a[i]))
      a[i+1]=(x-a[i])
if a[-2]+a[i-1]>x:
  if a[-1]>(x-a[-2]):
    ans+=(a[-1]-(x-a[-2]))
    a[-1]=(x-a[-2])
print(ans)
# Judge status: Wrong Answer
S = input()
print('x' * len(S))
# Judge status: Accepted
N = int(input())
s = [int(input()) for _ in range(N)]
s = sorted(s)
if sum(s) % 10 != 0:
  print(sum(s))
  exit()
else:
  for i in range(N):
    if (sum(s) - s[i]) % 10 != 0:
      print((sum(s) - s[i]))
      exit()

print(0)
# Judge status: Accepted
N = int(input())
tasks = []
for i in range(N):
    A, B = [int(x) for x in input().split()]
    tasks.append([B, A])
tasks.sort()

ok = True
S = 0
for i in range(N):
    B, A = tasks[i][0], tasks[i][1]
    S += A
    if S > B:
        ok = False
        break

if ok == True:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
S = input()
tmp = 0
for i in range(N):
  S1 = set(S[:i])
  S2 = set(S[i:])
  Sintcnt = len(S1 & S2)
  tmp = max(tmp, Sintcnt)
print(tmp)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

count=0
high=0

for i in range(n):
    if high>=a[i]:
        count+=high-a[i]
    else:
        high=a[i]
        
print(count)
# Judge status: Accepted
stations = input()
listStations = list(stations)
if len(set(listStations)) == 2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s=str(input())
if(s[-1]=="s"):
  	print(s+"es")
else:
	print(s+"s")
# Judge status: Wrong Answer
K, X = map(int,input().split())
if 500*K > X: 
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,M=map(int,input().split())
A=list(map(int,input().split()))
a=sum(A)
c=0
for i in range(N):
	if A[i]*4*M>=a:
		c+=1
if c>=M:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
def main():
    n = int(input())
    inlis = list(map(int,input().split()))
    inlis.sort()

    left = inlis[int(n//2)-1]
    right = inlis[int(n//2)]

    print(right-left)

if __name__ == "__main__":
    main()
# Judge status: Accepted
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()

    n, a, b = map(int, input().split())
    mod = 10 **9 + 7
    ans = pow(2, n, mod) -1
    c = 1
    for i in range(b):
        c *= n-i
        c%= mod
        c *= pow(i+1, mod-2, mod)
        c %= mod
        if i == a-1:
            ca = c
    ans -= (c+ca)%mod
    ans %= mod
    print(ans)
    





if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())

ans = [0]*N
for i in range(N-1):
    c,s,f = map(int,input().split())
    ans[i] += c+s
    for j in range(i):
        ans[j] = max((ans[j]+f-1)//f*f, s)+c
for a in ans:
    print(a)
# Judge status: Accepted
n = int(input())
s = input()

if n%2 == 0 and s[:(n//2)] == s[n//2:]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
k = int(input())
m = [False] * k
s = 0
d = 7 % k
i = 0
while True:
  s = (s + d) % k
  d = d * 10 % k
  i += 1
  if s == 0:
    print(i)
    break
  if m[s]:
    print(-1)
    break
  m[s] = True
# Judge status: Wrong Answer
def main():
    a, b, c, d = map(int, input().split())
    dx, dy = (c - a), (d - b)
    ans = "U" * dy + "R" * dx + "D" * dy + "L" * dx
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math
A = int(input())
B = math.floor(math.sqrt(A))
print(B ** 2)
# Judge status: Wrong Answer
N = int(input())
P = list(input(). split())
Q = sorted(P)
cnt = 0
i = 0

while cnt <= 2 and i < len(P):
  if Q[i] != P[i]:
    cnt += 1
  i += 1

if cnt == 0 or cnt == 2:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
def get_char_set(word):
    char_index = {}
    for i, c in enumerate(word):
        if c not in char_index.keys():
            char_index[c] = []
        char_index[c].append(i)
    char_set = set()
    for char_index_list in char_index.values():
        char_set.add(tuple(char_index_list))
    return char_set

s = input()
t = input()

s_char_set = get_char_set(s)
t_char_set = get_char_set(t)
if s_char_set == t_char_set:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')


def resolve():
    s = int(input())
    x0, y0 = 0, 0
    if s == 10 ** 18 or 10 ** 9:
        x1, y1 = 10 ** 9, 0
    else:
        x1, y1 = 10 ** 9, 1

    y2 = (s + x1 - 1) // x1
    x2 = 10 ** 9 - s % x1
    print(x0, y0, x1, y1, x2, y2)
    # print(s - abs(x1 * y2 - x2 * y1))


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
myset = set()
N = int(input())
for i in range(N):
    s = input()
    myset.add(s)
print(len(myset))
# Judge status: Accepted
#!/usr/bin/env python3
n, d = map(int, input().split())
l = []
ans = []

for i in range(n):
  l.append(list(map(int, input().split())))

for i in range(n-1):
  for j in range(i+1, n, 1):
    total = 0
    for k in range(d):
      total += abs(l[i][k] - l[j][k]) ** 2

    ans.append(total)

cnt = 0

for i in ans:
  for j in range(i+1):
    if j**2 == i:
      cnt += 1
      break

print(cnt)
# Judge status: Wrong Answer
n = int(input())
*a, = map(int, input().split())
s = sum(a)
ans = 1001001001
tmp = 0
for i in a[:-1]:
    tmp += i
    ans = min(ans, abs(tmp*2 - s))
print(ans)
# Judge status: Wrong Answer
n, k = input().split()

lst = list(map(int, input().split()))
res = ""
for i in range(len(n)):
    append = int(n[i])
    while (1):
        if append in lst:
            append = append + 1
        else:
            break
    res += str(append)

print(res)
# Judge status: Accepted
s = input()
x = len(s)
ans = 0
for i in range(int(x/2)):
  if s[i] != s[x-1-i]:
    ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
S = input()

eastNumber = S.count('E')
westNumber = 0
minimum = N

for i in range(N):
    if S[i] == 'E':
        eastNumber -= 1
        number = eastNumber + westNumber
        if minimum > number:
            minimum = number
    else:
        number = eastNumber + westNumber
        if minimum > number:
            minimum = number
        westNumber += 1

print(minimum)
# Judge status: Accepted
#178-C

N = int(input())

ans = 10**N - 2*9**N + 8**N

print(ans % (10**9+7))
# Judge status: Accepted
def main():
    N = int(input())
    S = list(input().rstrip())
    vals = [0]
    for s in S:
        if s == "I":
            vals.append(vals[-1] + 1)
        else:
            vals.append(vals[-1] - 1)
    print(max(vals))


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, x = map(int, input().split(" "))

ad = a // x
bd = b // x
ans = bd - ad
if a % x == 0:
    ans += 1
print(ans)
# Judge status: Accepted
s = set(input())
if ("W" in s and not "E" in s) or ("E" in s and not "W" in s) or ("N" in s and not "S" in s) or ("S" in s and not "N" in s):
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
N,L=map(int, input().split(" "))
s=[]
for i in range(N):
    s.append(input())

s.sort()
print(s)
# Judge status: Wrong Answer
n,m,k=map(int,input().split())

for i in range(n+1):
  for j in range(m+1):
    if i*m+j*n-i*j==k or i*m+j*n-i*j==n*m-k:
      print('Yes')
      exit()


print('No')
# Judge status: Wrong Answer
w,h,x,y = map(int,input().split())
sy = []
sx = []
sy.append((h-y)*w)
sy.append(y*w)
sx.append((w-x)*h)
sx.append(x*h)
sx_min = min(sx)
sy_min = min(sy)
if sx_min == sy_min:
    print(sx_min, 1)
else:
    print(max(sx_min,sy_min),0)
# Judge status: Accepted
a, b = map(int, input().split())

cnt = 0
for i in range(a, b+1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-2]:
        cnt += 1

print(cnt)
# Judge status: Wrong Answer
a = int(input())
s = input()

if a >= 3200:
  print("red")
else:  
  print(s)
# Judge status: Wrong Answer
import heapq, bisect

N = int(input())
H = []
min_lst = 10 ** 9
for _ in range(N):
    a = int(input())
    if min_lst >= a:
        min_lst = a
        heapq.heappush(H, -a)
    else:
        H[bisect.bisect_left(H, -a)] = a
print(len(H))
# Judge status: Accepted
N,x=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
for i in range(len(A)):
  if x-A[i]<0:
    print(i)
    exit()
  else:
    x-=A[i]
if x==0:print(N)
else:print(N-1)
# Judge status: Wrong Answer
n, k = map(int, input().split())
hl = []
for i in range(n):
    hl.append(int(input()))

hl.sort(reverse=True)

ans = 100000001

for j in range(n-k+1):
    s = hl[j] - hl[j+k-1]
    if s < ans:
        ans = s
    else:
        pass
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
if((a<c and c<b) or (b<c and c<a)):
		print('Yes')
else:
		print('No')
# Judge status: Wrong Answer
N = input()
T, A = map(int, input().split())
temperatures = list(map(int, input().split()))

r = 50000000
results = ''

list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - avg_temp
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)
# Judge status: Wrong Answer
n=int(input())
s=input()
m=0
if n%2==0:
    for i in range(n//2):
        if s[i]==s[i+n//2]:
            m+=1
print("Yes" if m==(n//2) else "No")
# Judge status: Accepted
S, W = map(int, input().split())
if S <= W:
  print('unsafe')
  
else:
  print('safe')
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))

min_num = 1
max_num = N
for i in range(M):
    min_input, max_input = list(map(int, input().split()))
    if min_input > min_num:
        min_num = min_input
    
    if max_input < max_num:
        max_num = max_input
        
print(max_num- min_num + 1)
# Judge status: Wrong Answer
a, b, c = input().split()
if int(str(a+b)) >= int(str(b+c)):
    print(int(str(a+b))+int(c))
else:
    print(int(str(b+c))+int(a))
# Judge status: Accepted
from fractions import gcd

A, B = map(int, input().split())
res = A * B // gcd(A, B)

print(res)
# Judge status: Wrong Answer
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
flag=False
for j in range(n):
  if j<n-1:
    if a[j]==a[j+1]:
      flag=True
if flag:
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
from collections import Counter

S = input()
c = Counter(S)

if len(c) == 3 and max(c.values()) - min(c.values()) <= 1:
    print("YES")
elif len(c) == 2 and max(c.values()) == min(c.values()):
    print("YES")
elif len(c) == 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n=int(input())
multi3 = [int(x.strip()) for x in input().split()]
ans=1
flag=True
for i in multi3:
    if ans*i>10**18:
        flag=False
    elif i==0:
        flag=True
        ans=0
        break
    else:
        ans*=i
if(flag):
    print(ans)
else:
    print(-1)
# Judge status: Accepted
N = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    if p[i] == i+1:
        p[i],p[i+1] = p[i+1],p[i]
        ans += 1
if p[N-1] == N:
    ans += 1
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
hill=list(range(1,n+1))
l=list(map(int,input().split()))
d={}
for i in range(n):
  d[i+1]=l[i]

for i in range(m):
  a,b=map(int,input().split())
  if d[a]>d[b]:
    if b in hill:
      hill.remove(b)
  if d[a]<d[b]:
    if a in hill:
      hill.remove(a)
  else:
    if a in hill:
      hill.remove(a)
    if b in hill:
      hill.remove(b)

print(len(hill))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

cash = 1000
stock = 0

for a, b in zip(A[:-1], A[1:]):
    if a <= b:
        n = int(cash / a)
        cash -= n * a
        stock += n
    else:
        cash += stock * a
        stock = 0

cash += stock * A[-1]
print(cash)
# Judge status: Accepted
import heapq
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(N)]

AB.sort(reverse=True)
works=[]
heapq.heapify(works)
ans=0
for i in range(1,M+1):
  day=M-i
  latest=i
  while AB and AB[-1][0]<=latest:
    a,b=AB.pop()
    heapq.heappush(works,-b)
  if not works:
    continue
  ans-=heapq.heappop(works)

print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    print(-(-n // 111)*111)

resolve()
# Judge status: Accepted
x,y = map(int,input().split())

ans = 0
sy = x
while sy <= y:
    sy *= 2
    ans += 1

print(ans)