peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,m=map(int,input().split())
p=[]
s=[]
for i in range(m):
	P,S=input().split()
	P=int(P)-1
	p.append(P)
	s.append(S)

wa=[0 for i in range(n)]
ac=[0 for i in range(n)]
for i in range(m):
	if s[i]=="AC":
		ac[p[i]]+=1
	else:
		if ac[p[i]]==0:
			wa[p[i]]+=1

sum_ac=0
pena=0
for i in range(n):
	if ac[i]!=0:
		sum_ac+=1
		pena+=wa[i]
print(sum_ac,end=' ')
print(pena)
# Judge status: Wrong Answer
h,a = map(int,input().split())
if h <= a :
    print(1)
else :
    print((h//a)+1)
# Judge status: Accepted
def calc(x):
    return (A * x) // B - A * (x // B)


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

x = 0
if N >= B:
    x = B-1
else:
    x = N

print(calc(x))
# Judge status: Accepted
import math

n = int(input())
a = [int(input()) for _ in range(5)]
print(math.ceil(n / min(a)) + 4)
# Judge status: Wrong Answer
n, k = map(int, input().split())
xs = list(map(int, input().split()))

res_lst = []
for i in range(n-k+1):
  lst = xs[i:i+k]
  res = 0
  for i, elem in enumerate(lst):
    if i > 0 and lst[i] * elem < 0:
      res += min(abs(lst[i]), elem) + elem
    else:
      res += abs(elem)
  res_lst.append(res)
print(min(res_lst))
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

while True:
  D -= B
  if D > 0:
    A -= C
    if A <= 0:
      print("No")
      exit()
  else:
    print("Yes")
    exit()
# Judge status: Accepted
def resolve():
    li = list()
    for i in range(2):
        line = input()
        li.append(line)
    ans = list()
    for i in range(2):
        line = li[1-i]
        al = line[2] + line[1] + line[0]
        ans.append(al)
    sp = ""
    for i in range(2):
        if ans[i] != li[i]:
            sp = "NO"
            break
    if sp != "NO":
        sp = "YES"
    print(sp)
resolve()
# Judge status: Accepted
N, K = map(int,input().split())
A = list(map(int,input().split()))
if (N-1)%(K-1)==0:
  print((N-1)//(K-1))
else:
  print((N-1)//(K-1)+1)
# Judge status: Accepted
A,B,M = [int(x) for x in input().split()]
A_list = [int(x) for x in input().split()]
B_list = [int(y) for y in input().split()]
discount = []
min = 200000
for _ in range(M):
  case = [int(x) for x in input().split()]
  discount.append(case)
 
min_a = sorted(A_list)[0]
min_b = sorted(B_list)[0]
 
for i in range(M):
  temp = A_list[discount[i][0]-1] + B_list[discount[i][1]-1] - discount[i][2]
  if temp < min:
    min = temp
    
if min_a + min_b > min:
  print(min)
else:
  print(min_a + min_b)
# Judge status: Wrong Answer
N = int(input())

yen1000 = round(N / 1000)
change = (yen1000)*1000 - N

print(change)
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=map(int,input().split())
if max(l)<min(r):
    print(0)
else:
    print(min(r)-max(l)+1)
# Judge status: Accepted
N = int(input())
ans = [0 for i in range(10 ** 4 + 1)]
for i in range(1,100):
    for i2 in range(1,100):
        for i3 in range(1,100):
            k = i**2 + i2 ** 2 + i3 ** 2 + i * i2 + i2 * i3 + i3 * i
            if k <= 10 ** 4:
                ans[k] += 1
for i in range(N):
    print(ans[i+1])
# Judge status: Accepted
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect
from decimal import *

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

a, b, c = map(int, input().split())
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    X=input()
    len_x=len(X)
    for i,x in enumerate(X):
        if x=="S":
            left_s=i
            break
    for i in range(len_x-1,-1,-1):
        if X[i]=="T":
            right_t=i
            break
    XX=X[left_s:right_t+1]
    xxc=Counter(XX)
    print(left_s+len_x-right_t-1+abs(xxc['S']-xxc['T']))

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

negative = 0
mi = 10 ** 9 + 1
zero = False
ans = 0
for ai in a:
    if ai < 0:
        negative += 1
    if abs(ai) < mi:
        mi = abs(ai)
    ans += abs(ai)
if negative % 2:
    ans -= 2 * mi
print(ans)
# Judge status: Accepted
S = input()

N = len(S)

ans = True
for i in range(N//2):
    ans = ans and S[i]==S[N-1-i]

S1 = S[:N//2]
S2 = S[N//2+1:]
N2 = len(S1)

for i in range(N2//2):
    ans = ans and S1[i] == S1[N2-1-i]
    ans = ans and S2[i] == S2[N2-1-i]

if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
X=[]
for i in range(n):
    s,p=input().split()
    X.append((s,100-int(p),i+1))
X=sorted(X,key=lambda x:(x[0],x[1]))
for i in range(n):
    print(X[i][2])
# Judge status: Accepted
x=int(input())
ans=(x//11)*2
amari=x%11
if 0<amari<7:
  ans+=1
elif amari>6:
  ans+=2
print(ans)
# Judge status: Accepted
def solve():
    n = int(input())
    s = input()
    ans = 1
    mod = 1000000007
    for i in range(26):
        c = chr(ord('a') + i)
        a = s.count(c)
        a = (a + 1) % mod
        ans = (ans * a) % mod

    ans = (ans + mod - 1) % mod
    print(ans)


if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
import numpy as np

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

A = np.array(a)
a_mul = int(np.prod(A))

if (a_mul) > int(10**18):
    print(-1)
else:
    print(a_mul)
# Judge status: Accepted
n=int(input())
s=input()
print('YNeos'[s[0:n//2]!=s[n//2:n]::2])
# Judge status: Accepted
def isKaibun(ss):    
    return ss==ss[::-1]

s = input()
ans=True
n=len(s)

if not isKaibun(s):
    ans=False
if not isKaibun(s[:((n-1)//2)]):
    ans=False

if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
flag = True
for i in range(N, 0, -1):
  if int(i*1.08) == N:
    print(i)
    flag = False
    break
if flag:
  print(':(')
# Judge status: Accepted
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    B = [(i+1)+a for i, a in enumerate(A)]
    from collections import Counter
    c = Counter()

    ans = 0
    for j in range(N):
        i = j
        v = (j+1) - A[j]
        ans += c[v]
        c[B[i]] += 1

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def main():
    has_said = set()
    n = int(input())
    last = ""
    for i in range(n):
        w = input()
        if i > 1 and (w[0] != last or w in has_said):
            print("No")
            break
        last = w[-1]
        has_said.add(w)
    else:
        print("Yes")


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, m = map(int, input().split())
mm = m//2
print(mm if n>mm else (mm-n)//2+n)
# Judge status: Accepted
x,y=map(int,input().split())
ans=0
if x==0 and y==0:
  print(ans)
  exit(0)
elif y==0:
  if x>0:ans+=1
  ans+=abs(x)
  print(ans)
  exit(0)
elif x==0:
  if y<0:ans+=1
  ans+=abs(y)
  print(ans)
  exit(0)

if x>0 and y>0:
  if x<=y:
    ans+=abs(y-x)
  else:
    ans+=abs(y-x)+2
elif (x>0 and y<0) or (x<0 and y>0):
  ans+=abs(abs(x)-abs(y))+1
elif x<0 and y<0:
  if x<=y:
    ans+=abs(y-x)
  else:
    ans+=abs(y-x)+2
print(ans)
# Judge status: Wrong Answer
#<100q.順列全探索>
#<15>
from itertools import combinations
n = int(input())
town = []
for i in range(n):
    x, y = map(int,input().split())
    town.append((x,y))

ans = 0
for i, j in combinations(town, 2):
    print(i, j)
    ans += ((i[0] - j[0]) ** 2 + (i[1] - j[1]) ** 2) ** (0.5)
print(2 * ans / n)
# Judge status: Accepted
n,k=map(int,input().split())
h=[0 for _ in range(n)]
for i in range(n):
    h[i]=int(input())
h.sort()
ans=10**9+7
for i in range(n-k+1):
    ans=min(ans,h[i+k-1]-h[i])
print(ans)
# Judge status: Accepted
n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]
flag = True
sortedab = sorted(ab, key=lambda x:x[1])
cleartime = [0]*n
cleartime[0] = sortedab[0][0]
if cleartime[0] > sortedab[0][1]:
    flag = False
else:
    for i in range(1, n):
        cleartime[i] = cleartime[i-1] + sortedab[i][0]
        if cleartime[i] <= sortedab[i][1]:
            continue
        else:
            flag = False
            break
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    x = int(input())
    if x%11 != 0:
        print((x//11)*2 + (x%11)//7 +1)
    else:
        print((x//11)*2 + (x%11)//7)


if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
for i in range(1, N):
   print(A.count(i))
# Judge status: Accepted
def d(x, y):
  return abs(x[0] - y[0]) + abs(x[1] - y[1])
n, m = map(int, input().split())
x = [tuple(map(int, input().split())) for i in range(n)]
y = [tuple(map(int, input().split())) for i in range(m)]
for i in range(n):
  p = 0
  for j in range(1, m):
    if d(x[i], y[j]) < d(x[i], y[p]):
      p = j
  print(p + 1)
# Judge status: Wrong Answer
import math
r = int(input())
x = 1*1*math.pi
print(int((r*r*math.pi)/x))
# Judge status: Accepted
import bisect

n = int(input())
ll = list(map(int, input().split()))
ll.sort()

ans = 0
for i in range(n-2):
    e1 = ll[i]
    for j in range(i+1, n-1):
        e2 = ll[j]
        comb = bisect.bisect_left(ll, e1+e2)
        comb -= (j+1)
        ans += max(comb,0)

print(ans)
# Judge status: Wrong Answer
import string
ans = []
N = int(input())

def rec(s, i):
    if len(s) == N:
        ans.append(s)
        return
    for c in string.ascii_lowercase[:i+1]:
        rec(s + c, i + 1)

rec("a", 1)
ans.sort()
for x in ans:
    print(x)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
A1 = A
B = list(map(int, input().split()))
B1 = B
p = A

cnt = A1[0]

if N == 1:
  print(A[0] + B[0])
  exit()

for i in range(N-1):
  if sum(A[i+1:]) > sum (B[i:-1]):
    cnt += A1[i+1]
    
  else:
    cnt += B1[i]
    


print(cnt + B1[-1])
# Judge status: Wrong Answer
n = int(input())
def main(n):
    if n == 1:
        return 1,0
    m = n //2 
    for i in range(1,m+1):
        if i * (i + 1) <= 2*n <= (i+1)*(i+2):
           right  = i + 1
           break
       
    diff = right * (right+1) //2 - n
       
    return right+1,diff


right,diff = main(n)

for i in range(1,right):
    if i != diff:
        print(i)
# Judge status: Wrong Answer
import math
a,b,c = map(int,input().split())

print(abs((a*b*((c//2)))-a*b*(math.ceil(c/2))))
# Judge status: Wrong Answer

n = int(input())
summmer = [""]*n
for i in range(n):
    summmer[i] = list(map(int,input().split()))
happy = [0]*(n+1)
yesterday = -1
for i in range(1,n+1):
    for j in range(3):
        if(j != yesterday):
            if(happy[i-1]+summmer[i-1][j] > happy[i]):
                happy[i] = happy[i-1] + summmer[i-1][j]
                today = j
    yesterday = today
    # print(happy,yesterday)
print(happy[-1])
# Judge status: Accepted
import decimal

a, b = input().split()

a = int(a)
b = decimal.Decimal(b)

result = a * b

print(int(result))
# Judge status: Wrong Answer
from math import ceil
def without_tax(a,b):
    w_a = ceil(a/0.08)
    m_w_a = ceil((a+1)/0.08)
    w_b = ceil(b/0.1)
    m_w_b = ceil((b+1)/0.1)
    if m_w_b < w_a or m_w_a < m_w_b:
        return -1
    return max(w_a,w_b)
a,b = [int(e) for e in input().split()]
print(without_tax(a,b))
# Judge status: Accepted
s=int(input())
dp=[0]*(s+1)
dp[0]=1

for i in range(s+1) :
    if i>=3 :
        dp[i]=dp[i-1]+dp[i-3]
        dp[i]%=1000000007
print(dp[s])
# Judge status: Wrong Answer
n = int(input())

C, S, F = [0] * n, [0] * n, [0] * n

for i in range(n - 1):
    C[i], S[i], F[i] = map(int, input().split())

for i in range(n):
    time = S[i]
    for j in range(i, n - 1):
        if time % F[j] == 0:
            time += C[j]
        elif time < S[j]:
            time = S[j] + C[j]
        else:
            time = time + F[j] - (time % F[j]) + C[i]
    print(time)
# Judge status: Accepted
N,M = map(int,input().split())
if N==1 and M==1:
    print(1)
elif (N>=1 and M==2) or (N==2 and M>=1):
    print(0)
elif (N==1 and M>=3) or (N>=3 and M==1):
    print(max(N,M)-2)
elif N>=3 and M>=3:
    print((N-2)*(M-2))
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
if A >= K:
    A = A-K
else:
    B=B-(K-A)
    A=0

print(str(A) + " " + str(B))
# Judge status: Wrong Answer
import collections

s = input()
s_set = set(s)
# Judge status: Accepted
N, K = map(int, input().split())
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()
ans = 10**10
for i in range(N-K+1):
    hmin = h[i]
    hmax = h[i+K-1]
    ans = min(ans, (hmax-hmin))
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())

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

ball_count = [1]*N

red_ball_cand = [0]*N
red_ball_cand[0] = 1

for i in range(M):
    x,y = XY[i]
    x,y = x-1,y-1
    if 0 < red_ball_cand[x]:
        red_ball_cand[y] = 1
        
    ball_count[x] -= 1
    ball_count[y] += 1
    
    if ball_count[x] == 0:
        red_ball_cand[x] = 0
print(sum(red_ball_cand))
# Judge status: Accepted
from math import cos, radians

a, b, h, m = map(int, input().split())

hs = 360 * h / 12 + 30 * m / 60
ms = 360 * m / 60

c = (
    max(hs, ms) - min(hs, ms)
    if max(hs, ms) - min(hs, ms) <= 180
    else 360 - (max(hs, ms) - min(hs, ms))
)
c = radians(c)
ans = (a ** 2 + b ** 2 - (2 * a * b * cos(c))) ** (1 / 2)
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

l = 0
r = max(a)

while r - l > 1:
    cnt = 0
    mid = (r + l) // 2
    for i in range(n):
        d = (a[i] - 1) // mid
        if d > 0: cnt += d
    if cnt <= k: r = mid
    else: l = mid 

print(r)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
for i in range(n):
    a[i][0]*=-1
a.sort()
a.sort(reverse=True, key=lambda x:x[1])
k=0
ans=0
# print(a)
for i in range(m):
    while k<n and -a[k][0]+i>m:
        k+=1
    if k<n:
        ans+=a[k][1]
        k+=1
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
def gcd(a,b):
  while b:a,b=b,a%b
  return a
def lcm(a,b):return a*b//gcd(a,b)
print(lcm(a,b))
# Judge status: Wrong Answer
import fractions
n = int(input())
a = list(map(int, input().split()))

gcd_from_left = [a[0]]
gcd_from_right = [a[-1]]

for i in range(1, n):
    gcd_from_left.append(fractions.gcd(gcd_from_left[i - 1], a[i]))
    gcd_from_right.append(fractions.gcd(gcd_from_right[i - 1], a[n - 1 - i]))

ans = max(gcd_from_left[n - 2], gcd_from_right[n - 2])
for i in range(1, n - 1):
    ans = max(ans, fractions.gcd(gcd_from_left[i - 1], gcd_from_right[i - 1]))
print(ans)
# Judge status: Accepted
s=input()
t=input()
d={}
l=[]
for i in range(len(s)):
  if s[i] in d and d[s[i]]!=t[i]:
    print('No') 
    exit()
  d[s[i]]=t[i]
if len(d.values())!=len(set(d.values())):
  print('No')
  exit()
print('Yes')
# Judge status: Accepted
n,m=map(int,input().split())
ans=0
if n==1 and m==1:
  ans=1
elif n==1 or m==1:
  ans=max(n,m)-2
else:
  ans=(n-2)*(m-2)
print(ans)
# Judge status: Accepted
s = list(input())
nick = s[0]+s[1]+s[2]
print(nick)
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))
d = {}
for i in range(N):
  d[L[i]] = i + 1
for j in range(1 , N + 1):
  print(d[j] , end = ' ')
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
T = list(input())
P = {'s':r, 'p':s, 'r':p}

mx = r*T.count('s')+s*T.count('p')+p*T.count('r')
if len(T)<k:
    print(mx)
else:
    for i in range(n-k):
        if T[i]==T[i+k]:
            mx -= P[T[i]]
            T[i+k] = '_'
print(mx)
# Judge status: Accepted
x = int(input())
cnt = 0
cnt += (x // 11) * 2
if 0 < x % 11 <= 6:
    cnt += 1
elif 6 < x % 11 < 11:
    cnt += 2
print(cnt)
# Judge status: Wrong Answer
#n,d=map(int,input().split())
#xy = [list(map(int,input().split())) for i in range(n)]
n=int(input())
c=list(input())
left=0
right=0
for i in range(0,n//2+1):
  if c[i]=="W":
    left+=1
  
for i in range(n//2+1,n):
  if c[i]=="R":
    right+=1
ans1=left+right-min(left,right)
aru=0
for i in range(n):
  if c[i]=="R":
    aru+=1
dab=n-aru

print(min(ans1,aru,dab))
# Judge status: Wrong Answer
import heapq
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

AB = sorted(AB, key=lambda x: x[0])

x = 0
res = 0

hq = []
heapq.heapify(hq)

for i in range(M):
    for j in range(x, N):
        if AB[j][0] > i+1:
            x = j
            break
        heapq.heappush(hq, AB[j][1]*-1)
    
    if hq:
        res += heapq.heappop(hq)*-1

print(res)
# Judge status: Accepted
A, B = map(int, input().split())
if A*B % 2 != 0:
  print("Odd")
else:
  print("Even")
# Judge status: Wrong Answer
s = list(map(int,input().split()))
s.sort
print(sum(s[:2]))
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

for i in range(N-1,0,-1):
    if H[i] - H[i-1] == -1:
        H[i-1] -= 1

for j in range(N-1):
    if H[j] > H[j+1]:
        print('No')
        break
else:
    print('Yes')
# Judge status: Wrong Answer
n=int(input())
S=list(input())
W=[0]*(n+1)
E=[0]*(n+1)
for i in range(n):
  W[i]=W[i-1]+S[i].count("W")
  E[n-i-1]=E[n-i]+S[n-i-1].count("E")
W = W[:n]
E = E[:n]
ans = 10000
for i in range(n):
  ans = min(ans,W[i]+E[i]-1)
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))
h.sort()

min_diff = 10**9
for hl, hr in zip(h, h[k-1:]):
    min_diff = min(min_diff, hr - hl)
print(min_diff)
# Judge status: Wrong Answer
N=int(input())
p=list(map(int,input().split()))
swap=[0,0]
cnt=0
for i in range(N):
    if (p[i]==i+1):
        if swap[0]==0:
            swap[0]=i+1
        else:
            swap[1]=i+1
            #print(swap)
            cnt=cnt+min(2,swap[1]-swap[0])
            swap=[0,0]
if swap[1]==0:
    cnt=cnt+1
print(cnt)
# Judge status: Accepted
import sys
input = sys.stdin.readline

def is_prime(n: int) -> bool:
    if n <= 3: return n > 1
    elif 0 in [n % 2, n % 3]: return False
    i = 5
    while i * i <= n:
        if 0 in [n % i, n % (i+2)]: return False
        i += 6
    return True

x = int(input())
while not is_prime(x): x += 1
print(x)
# Judge status: Accepted
import collections

N = int(input())
S = [0]*N
for i in range(N):
  S[i] = input()

dic = collections.Counter(S)
max_value = max(dic.values())

A = []

for k, v in dic.items():
  if v == max_value:
    A.append(k)

A = sorted(A)

for i in A:
  print(i)
# Judge status: Accepted
s = input()
if len(set(s)) == 26:
	print("None")
	exit()
for i in range(ord('a'), ord('z') + 1):
	if chr(i) not in s:
		print(chr(i))
		exit()
# Judge status: Accepted
import math
n = int(input())

x = n /1.08
price= math.ceil(x)

if math.floor(price*1.08) == n:
    print(price)
else:
    print(':(')
# Judge status: Accepted
import sys, heapq, bisect, math, fractions
from collections import deque

N = int(input())
A = [int(input()) for _ in range(N)]
sortA = sorted(A, reverse=True)

for i in range(N):
    if A[i] == sortA[0]:
        print(sortA[1])
    else:
        print(sortA[0])
# Judge status: Wrong Answer
n,m = map(int,input().split())
s = [[] for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    s[a-1].append(b)
    s[b-1].append(a)
for i in s:
    print(len(set(i)))
# Judge status: Wrong Answer
N = int(input())

s = [ str(v) for v in list(range(1, N+1))]
s_r = [str(int(v[::-1])) for v in s if int(v[::-1]) <= N]
s_r = sorted(list(set(s_r)))

count = 0
for s1 in s:
  for s2 in s_r:
    if (s1[0] == s2[-1]) & (s1[-1] == s2[0]):
      count = count + 1
print(count)
# Judge status: Accepted
N = int(input())
count = 0
for i in range(1,N+1):
    if (i%5==0)|(i%3==0):
        continue
    else:
        count+=i
print(count)
# Judge status: Accepted
# -*- coding: utf-8 -*-
N, X, T = map(int, input().split())

print((N // X) * T + (T if N % X != 0 else 0))
# Judge status: Accepted
a, b = map(int, input().split())
if a <= 0 <= b:
	print("Zero")
elif b < 0 and (b - a) % 2 == 0:
	print("Negative")
else:
	print("Positive")
# Judge status: Accepted
_ = '_'

arr = []

def solve(s):
    if _ in s:
        solve(s.replace(_, "+", 1))
        solve(s.replace(_, "-", 1))

    else:
        if eval(s) == 7:
            print(s + '=7')
            exit()


solve(_.join(list(input())))
# Judge status: Accepted
#! /usr/bin/env python3

import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())


def num_divisors_table(n):
    table = [0] * (n + 1)

    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1

    return table


table = num_divisors_table(N)

ans = 0
for i in range(N + 1):
    ans += i * table[i]

print(ans)
# Judge status: Wrong Answer
n = int(input())

ans = 0
surplus = 0
for i in range(n):
    a = int(input())
    if a == 0:
        surplus = 0
        continue
    a += surplus

    ans += a // 2
    surplus %= 2

print(ans)
# Judge status: Wrong Answer
s = int(input())
an = [s]
for i in range(1, 100):
    if an[i-1]%2==0:
        ins = an[i-1]//2
    else:
        ins = 3*an[i-1]+1

    if ins not in an:
        an.append(ins)
    else:
        print(i+1)
        exit()
# Judge status: Wrong Answer
def main():
    a, b, x = map(int, input().split())
    if x < a:
        ans = "No"
    else:
        if (x - a) > b:
            ans = "No"
        else:
            ans = "Yes"
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1):
    if i%K==0:
        print('OK')
        break
    if i==B:
        print('NG')
# Judge status: Accepted
N = input()
cnt = 0
for i in range(len(N) - 1): cnt += (N[i] == N[i + 1])
print('Yes') if cnt >= 2 and N[1]==N[2] else print('No')
# Judge status: Accepted
a = int(raw_input())
s = raw_input()

if a >= 3200:
    print s
else:
    print "red"
# Judge status: Accepted
N = input()

x = 0

for i in range(len(N)):
  x += int(N[i])
  x = x % 9

if x==0:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n=int(input())
x=[int(x) for x in input().split()]
x.sort(reverse=True)
f=1
ans=x[0]
ans+=(n-2)*x[1]
print(ans)
# Judge status: Accepted
import sys
n,m = map(int,input().split())
ls = [list(map(int,input().split())) for _ in range(m)]
di = []
new = []
for i in range(m):
    if ls[i][0] == 1:
        di.append(ls[i][1])
    if ls[i][1] == n:
        new.append(ls[i][0])
f = list(set(di) & set(new))
if len(f) > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N, Y = map(int, input().split())
res10000 =res5000 = res1000 = -1

for x in range(N+1):
    for y in range(N+1-x):
        z = N-x-y # zは決まっているので、ループを減らして、計算量を減らす！
        if 10000*x + 5000*y + 1000*z == Y:
            res10000 = x
            res5000 = y
            res1000 = z

print(res10000, res5000, res1000)
# Judge status: Wrong Answer
N = int(input())
mod = 10**9 + 7
if N == 1:
    print(0)
elif N == 2:
    print(2)
else:
    x = ((N * (N-1))*10**(N-2))
    print(x % mod)
# Judge status: Wrong Answer
n=int(input())
mod=10**9+7
ans=pow(n,10,mod)
ans-=2*pow(n,9,mod)
ans+=pow(n,8,mod)
print(ans%mod)
# Judge status: Accepted
a,b,c,d,e,k=(int(input())for _ in range(6))
print('Y:a(y !'[e-a>k::2])
# Judge status: Wrong Answer
a=int(input())

for i in range(a+1,10**6):
  isprime=True
  for j in range(2,i):
    if i%j==0:
      isprime=False
      break
  if isprime==True:
    print(i)
    exit()
# Judge status: Accepted
def main():
    n = int(input())
    X, Y = [], []
    for _ in range(n):
        x, y = map(int, input().split())
        X.append(x + y)
        Y.append(x - y)
    X.sort()
    Y.sort()
    print(max(X[-1] - X[0], Y[-1] - Y[0]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N = int(input())
T,A = (int(i) for i in input().split())
H = list(map(int, input().split()))


#Hi mの気温
#T_H =[-100]*N
dif =[100]*N
for i in range(N):
    T_H =T -H[i] *0.006
    dif[i] =abs(T_H -A)

ans =dif.index(min(dif)) #最小値のインデックス
print(ans +1)