Harryxun/stf_run huggingface dataset:
import time
import random
import math
def sigmoid(x):
  return 1/(1+math.exp(-x))
def score(a,c,s,d):
  l=[-1 for i in range(26)]
  r=0
  for i in range(d):
    l[a[i]]=i
    r+=s[i][a[i]]
    for j in range(26):
      r-=c[j]*(i-l[j])
  return r
  
st=time.time()
d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
  s.append(list(map(int,input().split())))

ans=[]
l=[-1 for i in range(26)]
ld=[]
for i in range(d):
  ms=-10**9
  mt=None
  for j in range(26):
    js=c[j]*(i-l[j])+s[i][j]
    if ms<js:
      ms=js
      mt=j
  l[mt]=i
  ans.append(mt)
  ld.append([l[mt],d])
  if l[mt]>=0:
    ld[l[mt]][1]=i

os=score(ans,c,s,d)
nt=st
rate=800
while nt-st<1.50:
  nt=time.time()
  na=[ans[i] for i in range(d)]
  na[random.randint(1,d-1)]=random.randint(0,25)
  ns=score(na,c,s,d)
  if sigmoid((ns-os)/rate/((2-nt+st)**3))>random.random():
    os=ns
    ans=na

for i in ans:
  print(i+1)

### FIXED CODE ###

d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
  s.append(list(map(int,input().split())))

ans=[]
l=[-1 for i in range(26)]
for i in range(d):
  ms=-10**9
  mt=None
  for j in range(26):
    js=c[j]*(i-l[j])+s[i][j]
    if ms<js:
      ms=js
      mt=j
  l[mt]=i
  ans.append(mt)

for i in ans:
  print(i+1)
N = int(input())
A = [int(x) for x in input().split(" ")]
B = [int(x) for x in input().split(" ")]

count = 0
for i in range(N):
    n_defeat = min(A[i], B[i])
    A[i] -= n_defeat
    B[i] -= n_defeat
    count += n_defeat
    n_defeat = min(A[i + 1], B[i])
    A[i + 1] -= n_defeat
    B[i] -= n_defeat
    count += n_defeat

print(count)

### FIXED CODE ###

import numpy

A, B = [int(x) for x in input().split(" ")]
if (A - B) % 2 == 0:
    print(abs(A + B) // 2)
else:
    print("IMPOSSIBLE")
def signal(a,e):
	s=""
	for i in range(7):
		s+="0" if a[i]==e[i] else "1"
	return s
		

ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
	n=input()
	if n==-1:break
	e="0000000"
	for i in range(n):
		a=ref[int(raw_input())]
		print signal(a,e)
		e=a

### FIXED CODE ###

ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass
def a(t,i):
    if i==l:
        if eval(t)==7:
            print(t+'=7')
            exit()
    a(t+'+'+s[i+1],i+1)
    a(t+'-'+s[i+1],i+1)

s = input()
l = len(s)-1
a(s[0],0)

### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))
s = []
for i in range(n):
    s.append(sorted(list(input())))
cnt_ans = 0
s.sort()

while len(s):
    cnt = 0
    for i in range(1, len(s)):
        if s[0] == s[i]:
            cnt += 1
        else:
            break
    cnt = int((cnt+1) * (cnt) / 2)
    cnt_ans += cnt
    s = s[cnt+1:]
print(cnt_ans)

### FIXED CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(sorted(list(input())))
cnt_ans = 0
s.sort()
cnt = 0
left = 0
right = 1
while right <= n-1:
    if s[left] == s[right]:
        right += 1
        cnt += 1
    else:
        left, right = right, right+1
        cnt_ans += ((cnt+1)*cnt//2)
        cnt = 0
    if right == n:
        cnt_ans += ((cnt+1)*cnt//2)
print(cnt_ans)
n=int(input())
d=sorted(list(map(int,input().split())))
print(d[n]-d[n-1])

### FIXED CODE ###

n=int(input())
d=sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])
import copy

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

target = A[0] ^ A[1] ^ A[2] ^ A[3]

results = [''] * n

for i in range(n):
    results[i] = str(target ^ A[i])

print(" ".join(results))


### FIXED CODE ###

import copy

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

target = 0
for i in range(n):
    target ^= A[i]

results = [''] * n

for i in range(n):
    results[i] = str(target ^ A[i])

print(" ".join(results))
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
def main():
    N, M, Q = map(int, input().split())
    r_list = []
    for i in range(Q):
        r_list.append(list(map(int, input().split())))
    max_score = 0
    a1 = 1
    for a2 in range(a1, M+1):
        for a3 in range(a2, M+1):
            for a4 in range(a3, M+1):
                for a5 in range(a4, M+1):
                    for a6 in range(a5, M+1):
                        for a7 in range(a6, M+1):
                            for a8 in range(a7, M+1):
                                for a9 in range(a8, M+1):
                                    for a10 in range(a9, M+1):
                                        a_list = [a1,a2,a3,a4,a5,a6,a7,a8,a9,a10]
                                        score = 0
                                        for r in r_list:
                                            if a_list[r[1]-1] - a_list[r[0]-1] == r[2]:
                                                score += r[3]
                                        max_score = max(score, max_score)
    print(max_score)

if __name__ == "__main__":
    main()




### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
import math
A, B, N = map(int, input().split())

def f(x):
    return math.floor(A*x/B) - A * math.floor(x/B)

def main():
    print(f(min(N, B-1)))

if __name__ == "__main__":
    main()
A, B = map(int, input().split())
print ((A-1)*(B-1)

### FIXED CODE ###

A, B = map(int, input().split())
print ((A-1)*(B-1))
n = int(input())
_A = list(map(int, input().split()))
ans = 1000
A = [_A[0]]
B = []

for i in range(n-1):
  if (_A[i] != _A[i + 1]):
    A.append(_A[i+1])

flag = 0
for i in range(len(A)-1):
  if (flag == 0 and A[i] < A[i + 1]):
    flag = 1
    B.append(A[i])
  elif (flag == 1 and A[i] > A[i + 1]):
    flag = 0
    B.append(A[i])
if((A[-1] > A[-2] and flag == 1) or (A[-1] < A[-2] and flag == 0)):
  B.append(A[-1])
if(len(B) < 2):
  print(ans)
  exit()
if(B[-1] < B[-2]):
  B.pop(-1)

stock = 0
for i,b in enumerate(B):
  if(i % 2 == 0):
    stock = ans // b
    ans = ans % b
  else:
    ans = ans + stock * b
    stock = 0

print(ans)

### FIXED CODE ###

n = int(input())
_A = list(map(int, input().split()))
ans = 1000
A = [_A[0]]
B = []

for i in range(n-1):
  if (_A[i] != _A[i + 1]):
    A.append(_A[i+1])

flag = 0
if(len(A) < 2):
  print(ans)
  exit()
for i in range(len(A)-1):
  if (flag == 0 and A[i] < A[i + 1]):
    flag = 1
    B.append(A[i])
  elif (flag == 1 and A[i] > A[i + 1]):
    flag = 0
    B.append(A[i])
if((A[-1] > A[-2] and flag == 1) or (A[-1] < A[-2] and flag == 0)):
  B.append(A[-1])
if(len(B) < 2):
  print(ans)
  exit()
if(B[-1] < B[-2]):
  B.pop(-1)

stock = 0
for i,b in enumerate(B):
  if(i % 2 == 0):
    stock = ans // b
    ans = ans % b
  else:
    ans = ans + stock * b
    stock = 0

print(ans)
a, p = [*map(int, input().split())]
print((a * 3 + p) // 2)

### FIXED CODE ###

a, p = list(map(int, input().split()))
print('{}'.format((a * 3 + p) // 2))
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

dis = B-A
mob = W-V

if A == B:
    print("Yes")
else:
    if dis % mob != 0:
            print("No")
    else:
            if dis + (mob*T) <= 0:
                print("Yes")
            else:
                print("No")

### FIXED CODE ###

a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if (v-w)*t>=abs(b-a):
    print("YES")
else:
    print("NO")
a = input() 
b = input()

a=int(a)
b=int(b)

if (a * b)/2 = 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

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

if (a * b)%2 == 0:
  print('Even')
else:
  print('Odd')
MOD=10**9+7
import bisect
N,K=[int(s) for s in input().split()]
ls=[int(s) for s in input().split()]
ls=sorted(ls)
s=bisect.bisect_left(ls,0)
t=bisect.bisect_right(ls,0)
mls=ls[:s]
pls=ls[t:]
M=s
P=N-t
ans=set()
#プラスの値にすること不可能か？
if (P==0 and K%2==1) or (N==K and M%2==1):
  #ゼロにできるか？
  if N-P-M>0:
    print(0)
  else:
    mls.reverse()
    mul=1
    if P==0:
      for i in range(K):
        mul*=mls[i]
    else:
      for i in range(N):
        mul*=ls[i]
    ans.add(mul)
else:
  pls.reverse()
  for a in range(K+1)[::2]:
  #  print(a,pls[:K-a+1],mls[:a])
    if K-a>P:
      continue
    if a>M:
      break
    mul=1
    for i in range(a):
      mul*=mls[i]
    for i in range(K-a):
      mul*=pls[i]
    ans.add(mul)
print(max(ans)%MOD)


### FIXED CODE ###

MOD=10**9+7
N,K=[int(s) for s in input().split()]
ls=[int(s) for s in input().split()]
ans=set()
ls=sorted(ls, key=lambda x: -abs(x))
mul=1
sign=0
zeroflag=0
flag=[0 for _ in range(N)]
for i in range(K):
  flag[i]=1
  if ls[i]<0:
    sign=(sign+1)%2
if sign==1:
  if 0 in ls:
    zeroflag=1
  a=[0,0,0,0]
  b=[0,0,0,0]
  for j in range(K,N):
    if ls[j]>0:
      for k in range(K):
        if ls[K-1-k]<0:
          a[0]=ls[j]
          b[0]=j
          a[1]=ls[K-1-k]
          b[1]=K-1-k
          break
      break
  for j in range(K,N):
    if ls[j]<0:
      for k in range(K):
        if ls[K-1-k]>0:
          a[2]=ls[j]
          b[2]=j
          a[3]=ls[K-1-k]
          b[3]=K-1-k
          break
      break
  if a==[0,0,0,0]:
    flag.reverse()
  elif b[0]==0 and b[1]==0:
    flag[b[2]]=1
    flag[b[3]]=0
  elif b[2]==0 and b[3]==0:
    flag[b[0]]=1
    flag[b[1]]=0
  elif abs(a[0]*a[3])>abs(a[1]*a[2]):
    flag[b[0]]=1
    flag[b[1]]=0
  else:
    flag[b[2]]=1
    flag[b[3]]=0
if sign==1 and a==[0,0,0,0] and zeroflag==1:
  print(0)
else:
  mul=1
  for i in range(N):
    if flag[i]==1:
      mul=mul*ls[i]%MOD
  print(mul)
N, M = map(int, input().split())
LRC = [list(map(int, input().split())) for _ in range(M)]
INF = 10 ** 10
LRC.sort(key=lambda x: x[2], reverse=True)
LRC.sort()
dp = [INF] * (N+1) # dp[0]は使わない
dp[1] = 0
for l, r, c in LRC:
    x = dp[l] + c
    for i in range(r+1, l-1, -1):
        if dp[i] > x:
            dp[i] = x
        else:
            break
if dp[N] == INF:
    print(-1)
else:
    print(dp[N])


### FIXED CODE ###

import sys
from heapq import heapify, heappop, heappush

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def dijkstra(start):
    dist = [INF] * (N+1)
    dist[start] = 0
    que = [(0, start)]
    while que:
        d, prev = heappop(que)
        if dist[prev] < d:
            continue
        for cost, next in graph[prev]:
            d1 = d + cost
            if dist[next] > d1:
                dist[next] = d1
                heappush(que, (d1, next))
    return dist

N, M = lr()
INF = 10 ** 15
graph = [[] for _ in range(N+1)] # 1-indexed
for i in range(2, N+1):
    graph[i].append((0, i-1))

for _ in range(M):
    l, r, c = lr()
    graph[l].append((c, r))

dist = dijkstra(1)

if dist[N] == INF:
    print(-1)
else:
    print(dist[N])
# 19
N,T = map(int,input().split())
comp = []
for i in range(N):
    nt = [int(i) for i in input().split()]
    comp.append(nt)


cost = []
for i in range(N):
    if comp[i][1] <= T:
        temp = [comp[i][0],comp[i][1]]
        cost.append(temp)
cost = sorted(cost, key = lambda x:x[1])
print(cost[0][0])

### FIXED CODE ###

N,Y = map(int,input().split())
ct = {}
for i in range(N):
    temp = [int(i) for i in input().split()]
    if temp[1] > Y:
        pass
    else:
        ct[temp[0]] = temp[1]

if len(ct) > 0:
    ct = sorted(ct.items(),key=lambda x: x[0])
    print(ct[0][0])
else:
    print("TLE")
n = int(input())
a = [int(input()) for i in range(n)]
b = sorted(a)

for A in a:
    if A == b[n - 1]:
        print(b[n - 2])
    else:
        print(b[n - 1])


### FIXED CODE ###

r = int(input())

print(3 * r * r)
import queue

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
H, W = map(int, input().split())
field = [input() for _ in range(H)]

dist = [[-1] * W for _ in range(W)]
que = queue.Queue()
que.put((0, 0))
dist[0][0] = 0

while not que.empty():
  y, x = que.get()
  for i in range(4):
    ny, nx = y + dy[i], x + dx[i]
    if nx < 0 or nx >= W or ny < 0 or ny >= H:
      continue
    if field[ny][nx] == '#':
      continue
    if dist[ny][nx] != -1:
      continue
    dist[ny][nx] = dist[y][x] + 1
    que.put((ny, nx))
    
count = 0
for y in range(H):
  for x in range(W):
    if field[y][x] == '#':
      count += 1
      
if dist[H - 1][W - 1] != -1:
  print(H * W - count - dist[H - 1][W - 1])
else:
  print(-1)

### FIXED CODE ###

from collections import deque

R,C = list(map(int,input().split()))
Sx,Sy = 0,0
Gx,Gy = R-1,C-1
Mize = [input() for _ in range(R)]
dd = [[1, 0], [-1, 0], [0, 1], [0, -1]]

def bfs():
    d = [[float('inf')] * C for i in range(R)]
    q = deque([])
    d[Sx][Sy] = 0
    q.append((Sx,Sy))
    while(len(q) != 0):
        x,y = q.popleft()
        if x == Gx and y == Gy:
            break
        for dx,dy in dd:
            
            if -1<x+dx<R and -1<y+dy<C and Mize[x+dx][y+dy]=='.' and d[x+dx][y+dy] == float('inf'):
                q.append([x+dx,y+dy])
                d[x+dx][y+dy] = d[x][y] + 1
    return d[Gx][Gy]

white = sum([m.count('#') for m in Mize])
need = bfs()
if need == float('inf'):
    print(-1)
else:
    print(R*C-white-need-1)
# ABC_177_E_3.py

# 解説を見て高速素因数分解を実装する

D = [0]*(10**6+1)
L = [True]*(10**6+1)
L[0] = False
L[1] = False
D[1] = 1
for i in range(2, 10**6+1):
    if L[i]:
        D[i] = i
        for j in range(i*2, 10**6+1, i):
            L[j] = False
            D[j] = i


def egcd(a, b):
    if a == 0:
        return b
    else:
        g = egcd(b % a, a)
        return g


def factorization(n):
    if n == 1:
        return {1}
    ans = set()
    ans.add(D[n])
    factorization(n//D[n])
    return ans


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

s = set()
for i in range(N):
    tmp = factorization(A[i])-{1}
    if tmp & s != set():
        break
    s.add(tmp)
else:
    print('pairwise coprime')
    exit()

L1 = A
while len(L1) > 1:
    l = len(L1)//2
    tmp = [0]*l
    for i in range(l):
        tmp[i] = egcd(L1[2*i], L1[2*i+1])
    if len(L1) % 2 == 1:
        tmp.append(L1[-1])
    L1 = tmp

if L1[0] == 1:
    print('setwise coprime')
else:
    print('not coprime')


### FIXED CODE ###

INF=10**9+7
D = [INF]*(10**6+1)
L = [True]*(10**6+1)
L[0] = False
L[1] = False
D[1] = 1
for i in range(2, 10**6+1):
    if L[i]:
        D[i] = i
        for j in range(i*2, 10**6+1, i):
            L[j] = False
            D[j] = min(i, D[j])
# print(D[:101])


def egcd(a, b):
    if a == 0:
        return b
    else:
        g = egcd(b % a, a)
        return g


def factorization(n):
    ans = set()
    if n == 1:
        ans.add(1)
        return ans
    while n>1:
        ans.add(D[n])
        n//=D[n]
    return ans


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

s = set(factorization(A[0])-{1})
for i in range(1, N):
    tmp = factorization(A[i])-{1}
    if tmp & s != set():
        break
    s |= tmp
else:
    print('pairwise coprime')
    exit()

L1 = A
while len(L1) > 1:
    l = len(L1)//2
    k = [0]*l
    for i in range(l):
        k[i] = egcd(L1[2*i], L1[2*i+1])
    if len(L1) % 2 == 1:
        k.append(L1[-1])
    L1 = k

if L1[0] == 1:
    print('setwise coprime')
else:
    print('not coprime')
import math as ma
inputs = input().split(" ")
A = int(inputs[0])
B = int(inputs[1])
X = int(inputs[2])

# １桁
max_num = 0
for x in range(1, 19):
    k = ma.floor((X - x*B) / A)
    # print(x, k)
    if len(list(str(k))) == x:
        max_num = k
        break
    elif len(list(str(k))) < x:
        break
    elif len(list(str(k))) > x:
        pass
if max_num > 1000000000:
    max_num = 1000000000
print(max_num)


### FIXED CODE ###

inputs = input()
num = 0
if inputs == "SUN":
    num = 7
elif inputs == "MON":
    num = 6
elif inputs == "TUE":
    num = 5
elif inputs == "WED":
    num = 4
elif inputs == "THU":
    num = 3
elif inputs == "FRI":
    num = 2
elif inputs == "SAT":
    num = 1

print(num)
def fib_memo(n):
    """メモ化フィボナッチ"""
    memo = [0]*(n+1)

    def _fib(n):
        if n <= 1:
            return n
        if memo[n] != 0:
            return memo[n]
        memo[n] = _fib(n-1) + _fib(n-2)
        return memo[n]

    return _fib(n)
  
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = [0]*(M-1)
for i in range(M):
  diff = 0
  if i == 0:
    diff = A[i] - 1
    B[0] = fib_memo(diff + 1)
  else if i == (M - 1):
    diff = N - A[M-1] -1
    B[M-1] = fib_memo(diff + 1)
  else:
    diff = A[i] - A[i-1]
    B[i] = fib_memo(diff + 1)
Ans = reduce(lambda a, b: a*b, B)
print(Ans % 1000000007)
    

### FIXED CODE ###

N, M = map(int, input().split())
A = [True] * (N+1)
for _ in range(M):
  idx = int(input())
  A[idx] = False

step = [0] * (N+1)
step[0] = 1
for i in range(1, N+1):
  if A[i]:
    step[i] = step[i-1] + step[i-2]
  else:
    step[i] = 0
print(step[N]%(10**9+7))
import itertools 
n=int(input())
p=list(map(int, input().split()))
q=list(map(int, input().split()))

cnt=0
for v in itertools.permutations(range(1,n+1), n):
    cnt +=1
    if(p==v):
        a = cnt
    if(q==v):
        b = cnt

print(abs(a-b))

### FIXED CODE ###

import itertools
n = int(input())
p = tuple(((map(int,input().split()))))
q = tuple(((map(int,input().split()))))

num = []
for i in range(1,n+1):
    num.append(i)
ans = []
for i in itertools.permutations(num,n):
    ans.append(i)

print(abs(ans.index(p)-ans.index(q)))
def main():
    """
    英小文字のみからなる文字列 S, T
    文字列 Sに対して、次の操作を何度でも行うことができます。

    操作
        2つの異なる英小文字 c1, c2を選び、
        Sに含まれる全ての 
        c1 を c2に、
        c2 を c1に、置き換える

    0回以上操作を行って、S を Tに一致させられるか判定

    1 <= |S| = |T| <= 2 * 10^5
    """
    S = input()
    T = input()

    ans = f(S, T)
    print(ans)


if True:
    import pytest

    @pytest.mark.randomize(S=str, T=str,
                           min_length=10, max_length=10,
                           str_attrs=("ascii_lowercase",))
    def test_f(S, T):

        assert f(S, T)


def f(S, T):
    """
    26文字存在しないとき
    S: abc
    T: def
        a -> d にしたい
        dbc
        dはSに存在しないので好きに変えられる, でよいか

    S: abc
    T: ddf
        a -> d: dbc
        b -> d: dが存在する
        bを存在しないものに変える: dzc, 状況は変わらない
        a,b入れ替えても意味がない
        a->x, b->x and x->b: bxc, 状況は変わらない

        割当がかぶっていると無理っぽい

    仮に3文字しか種類がない
    S: abc
    T: cab
        c->a, a->c: cba
        b->a, a->b: cab
    """
    import string
    ds = {c: set() for c in string.ascii_lowercase}
    dt = {c: set() for c in string.ascii_lowercase}
    for c1, c2 in zip(S, T):
        ds[c2].add(c1)
        dt[c1].add(c2)

    for c in string.ascii_lowercase:
        if len(ds[c]) >= 2 or len(dt[c]) >= 2:
            return "No"

    return "Yes"


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    """
    英小文字のみからなる文字列 S, T
    文字列 Sに対して、次の操作を何度でも行うことができます。

    操作
        2つの異なる英小文字 c1, c2を選び、
        Sに含まれる全ての 
        c1 を c2に、
        c2 を c1に、置き換える

    0回以上操作を行って、S を Tに一致させられるか判定

    1 <= |S| = |T| <= 2 * 10^5
    """
    S = input()
    T = input()

    ans = f(S, T)
    print(ans)


if False:
    import pytest

    @pytest.mark.randomize(S=str, T=str,
                           min_length=10, max_length=10,
                           str_attrs=("ascii_lowercase",))
    def test_f(S, T):
        assert f(S, T)


def f(S, T):
    """
    26文字存在しないとき
    S: abc
    T: def
        a -> d にしたい
        dbc
        dはSに存在しないので好きに変えられる, でよいか

    S: abc
    T: ddf
        a -> d: dbc
        b -> d: dが存在する
        bを存在しないものに変える: dzc, 状況は変わらない
        a,b入れ替えても意味がない
        a->x, b->x and x->b: bxc, 状況は変わらない

        割当がかぶっていると無理っぽい

    仮に3文字しか種類がない
    S: abc
    T: cab
        c->a, a->c: cba
        b->a, a->b: cab
    """
    import string
    ds = {c: set() for c in string.ascii_lowercase}
    dt = {c: set() for c in string.ascii_lowercase}
    for c1, c2 in zip(S, T):
        ds[c2].add(c1)
        dt[c1].add(c2)

    for c in string.ascii_lowercase:
        if len(ds[c]) >= 2 or len(dt[c]) >= 2:
            return "No"

    return "Yes"


if __name__ == '__main__':
    main()
input();I=map(int,input().split());t,a=I();d,i=9**9,0
for j,v in enumerate(I()):
 w=abs(a-t+v*0.006)
 if w<d:d=w;i=j
print(i+1)

### FIXED CODE ###

n,t,a,*h=map(int,open(0).read().split())
d,i=10**18,0
for j in range(n):
  if abs(a-t+h[j]*0.006)<d:
    d=abs(a-t+h[j]*0.006)
    i=j
print(i+1)
import copy
import sys
sys.setrecursionlimit(10**7)

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b

def main():
    n, m = map(int, input().split())
    # これだと72がREになる
    A = [int(x) for x in input().split()]
    # A_s = set(A)
    # A_ = copy.deepcopy(A)
    # a_lcm = A.pop()
    a_lcm = 1
    # Aの要素が複数ならlcmを計算する
    #if len(A) >= 1:
    for a in A:
        a_lcm = lcm(a_lcm, a)
    #else:
    #    a_lcm = a_lcm
    # 元のAの値とlcmの半分の値を割り切れるものがあったら0
    #for i in A_:
    for a in A:
        # if a_lcm / 2 % a == 0:
        if (a_lcm / a) % 2 == 0: 
            print(0)
            # exit()
        # else:
        #     continue
    else:
        print(2)
    # # mがlcmの半分よりも小さかったら0
    # if (a_lcm / 2) > m:
    # # if a_lcm > m * 2:
    #     print(0)
    #     exit()
    # else:
    #     # # あとは定数倍の数調べて終わり
    #     ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    #     print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
import sys
def sieve(m):
    N=range(1,m+2,2)
    r=int(m**.5)
    h=len(N)
    N[0]=0
    for i in range(h):
        x=N[i]
        if x>r: break
        if x and i+x<h: N[i+x:h:x]=[0] * ((h-1-i-x)/x+1)
    return N
def f0056(n):
    x=0
    if n%2==1:
        if SIEVES[(n-2)/2]!=0: x=1
    else:
        for e in PRIMES:
            if e>n/2: break
            if SIEVES[(n-e)/2]!=0]:x+=1
    return x
        
SIEVES=sieve(50000)
PRIMES=filter(None,SIEVES)
for n in sys.stdin:
    n=int(n)
    if n==0: break
    print f0056(n)

### FIXED CODE ###

import sys
def sieve(m):
    N=range(1,m+2,2)
    r=int(m**.5)
    h=len(N)
    N[0]=0
    for i in range(h):
        x=N[i]
        if x>r: break
        if x and i+x<h: N[i+x:h:x]=[0]*((h-1-i-x)/x+1)
    return N
def f0056(n):
    x=0
    if n<4:x=0
    elif n==4:x=1
    elif n%2==1:
        if S[n/2-1]: x=1
    else:
        a=n/2
        for e in PRIMES:
            if e>a: break
            if S[(n-e)/2]: x+=1
    return x

S=sieve(50000)
PRIMES=filter(None,S)
for n in sys.stdin:
    n=int(n)
    if n==0: break
    print f0056(n)
N = int(input())

if N == 1:
    print(1)
    sys.exit()

mylist = list(map(int, input().split()))


myans = 1
minn = mylist[0]
for i in range(N):
    if mylist[i] < minn:
        minn = mylist[i]
        myans += 1
    else:
        minn = mylist[i]
        
print(myans)
        

### FIXED CODE ###

N = int(input())


mylist = list(map(int, input().split()))


myans = 0
mymin = 9999999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)
n = int(input())
As = list(map(int,input().split()))

ans = 1

for i in as:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    print(-1)

print(ans)


### FIXED CODE ###

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

print(a[0]*a[1])