Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import numpy as np
from itertools import permutations
N = int(input())
coodinate = []
for _ in range(N):
    x , y = map(int,input().split())
    coodinate.append([x,y])
coodinate = np.array(coodinate)
distance = []
for val in permutations(coodinate):
    now_distance = 0
    for i in range(N-1):
        now_distance += np.linalg.norm(val[i+1] - val[i])
    distance.append(now_distance)
print(sum(distance) / len(distance))

### FIXED CODE ###

import math
from itertools import permutations
N = int(input())
coodinate = [list(map(int,input().split())) for _ in range(N)]
f_N = math.factorial(N)
SumDistance = 0
j = 0
for val in permutations(coodinate):
    #if j >= math.factorial(N) // 2:
    #    break
    #print(val)
    for i in range(N-1):
        SumDistance += ((val[i+1][0] - val[i][0]) ** 2 + (val[i+1][1] - val[i][1]) ** 2) ** (1 / 2)
    #j += 1

print(SumDistance / math.factorial(N))
### BUGGY CODE ###

def main():

    import sys
    input = sys.stdin.readline
    from bisect import bisect_left

    N,Q = map(int,input().split())
    info = []
    for _ in range(N):
        s,t,x = map(int,input().split())
        info.append((x,s,t))
    info = sorted(info)
    tmp = sorted([(int(input()),i) for i in range(Q)])
    D = []
    ID = []
    for d,i in tmp:
        D.append(d)
        ID.append(i)

    bit = [1]*Q
    ans = [-1]*Q
    for x,s,t in info:
        left = bisect_left(D,s-x)
        right = bisect_left(D,t-x)
        for j in range(left,right):
            i = ID[j]
            if bit[i]:
                ans[i] = x
                bit[i] = 0
    
    print(*ans, sep="\n")

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
from bisect import bisect_left
inf = float('inf')

N, Q = map(int,input().split())
STX = [list(map(int,input().split())) for _ in range(N)]
D = [int(input()) for _ in range(Q)]

res = 1
while res < Q:
    res <<= 1
N0 = res
data = [inf for _ in range(2*N0-1)]

def update(l, r, x):
    L = l + N0
    R = r + N0
    while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1

def value(k):
    k += N0
    res = data[k]
    while k != 0:
        k >>= 1
        res = min(res, data[k])
    return res


for S, T, X in STX:
    l = bisect_left(D, S-X)
    r = bisect_left(D, T-X)
    update(l, r, X)

for k in range(Q):
    ans = value(k)
    if ans == inf:
        ans = -1
    print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]
lst = sorted(lst, key=lambda x:x[0])
lst = sorted(lst, key=lambda x:x[1], reverse=True)
#print(lst)
cnt = 0
ans = 0
cntup = m
while cntup != 0:
  cnt += 1
  lst_f = [j for j in lst if j[0]<=cnt]
  #print(filter(lambda y:y<=m-i, map(lambda x:x[0], lst)))
  #lst2 = list(filter(lambda y:y[1]<=m-i, lst))
  #print(lst_f)
  if lst_f != []:
    #print(lst)
    ans += lst_f[0][1]
    lst.remove(lst_f[0])
    cntup -= 1
  if lst == [] or cnt==m:
    break
print(ans)


### FIXED CODE ###

from heapq import heappop, heappush
n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]
lst_f = [[] for i in range(m)]
#lst = sorted(lst, key=lambda x:x[0])
#lst = sorted(lst, key=lambda x:x[1], reverse=True)
cnt = 0
ans = 0
cntup = m
for a, b in lst:
  if a <= m:
    lst_f[a-1].append(b)
  #print(filter(lambda y:y<=m-i, map(lambda x:x[0], lst)))
  #lst2 = list(filter(lambda y:y[1]<=m-i, lst))
avb = [] 
for i in lst_f:
  for j in i:
    heappush(avb, -j)
  if avb != []:
    ans -= heappop(avb)
print(ans)
### BUGGY CODE ###

n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())

for i in range(n):
  print(max(a[:i]+a[i+1:]))

### FIXED CODE ###

import copy
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
b=copy.deepcopy(a)
m1=max(a)
a.remove(m1)
m2=max(a)
for i in range(n):
  if b[i]==m1:
    print(m2)
  else:
    print(m1)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n

if (z == x):
  u = n - 1
  d = n - 1
elif (z == o):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def toggle(i):
  if (i == '1'):
    return '0'
  else:
    return '1'
    

def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 1)
for i in range(1, 2 * 10 ** 5):
  ans[i] = solve(i, 0)
for i in range(n):
  if(i == 0):
    _x = toggle(x[0]) + x[1: n]
  elif (i == n - 1):
    _x = x[:i] + toggle(x[n - 1])
  else:
    _x = x[:i] + toggle(x[i]) + x[i + 1 :n]
  if(x[i] == '0'):
    print(solve2(int(_x, 2), u))
  else:
    print(solve2(int(_x, 2), d))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (n == 1 and x == '1'):
  print(0)
  exit()

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 4)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
if(d != 0):
  _d = (2 * 10 ** 5) // d
  D = X % d + (d * _d) * 2 + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 4):
  ans[i] = solve(i, 0)
Us[0] = 1 % u
if(d != 0):
  Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i - 1] * 2) % u
  if(d != 0):
    Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(x[i] == '0'):
    print(solve2(U + Us[n-i-1], u))
  else:
    if (d == 0):
      print(0)
    else:
      print(solve2(D - Ds[n-i-1], d))
### BUGGY CODE ###

n = int(input())
s = input()

num = 0
for i in range(0,n):
  for j in range(i+1,n):
    if s[i]==s[j]:
      continue
    for k in range(j+1,n):
      if s[i]!= s[k] and s[j]!=s[k] and (j-i)!=(k-j):
        num += 1
print(num)

### FIXED CODE ###

n = int(input())
s = input()

r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')

total = r_cnt*g_cnt*b_cnt

for i in range(0,n):
  for j in range(1,n):
    if i+(2*j)>=n:
      break
    if s[i]!=s[i+j] and s[i+j]!=s[i+2*j] and s[i]!=s[i+2*j]:
      total += -1

print(total)
### BUGGY CODE ###

import bisect
n = int(input())
s = input()
R,G,B = [],[],[]
for i in range(n):
    if s[i]=='R':
        R.append(i)
    elif s[i]=='G':
        G.append(i)
    else:
        B.append(i)
B = tuple(B)
if len(R)==0 or len(G)==0 or len(B)==0:
    print(0)
    exit()
cnt = 0
for r in R:
    for g in G:
        a,b = min(r,g), max(r,g)
        if 2*a-b in B:
            cnt += 1
        if 2*b-a in B:
            cnt += 1
        if (b-a)%2==0 and a+(b-a)//2 in B:
            cnt += 1
print(len(R)*len(G)*len(B)-cnt)

### FIXED CODE ###

n = int(input())
s = input()
ans = s.count('R')*s.count('G')*s.count('B')
if ans==0:
    print(ans)
else:
    for i in range(n):
        for j in range(i+1, n):
            k=2*j-i
            if k<n:
                if s[i]!=s[j] and s[j]!=s[k] and s[i]!=s[k]:
                    ans -= 1
    print(ans)
### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-08-18 14:44:25 +0900
# LastModified: 2020-09-11 15:23:10 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def pivot_index(change_box, i, which):
    if which == 0:
        for cb in change_box:
            if cb >= i:
                return cb
    else:
        for j in range(len(change_box)-1, -1, -1):
            if change_box[j] <= i:
                return change_box[j]


def main():
    S = input()
    change_box = []
    floor_chart = 1
    i = 0
    while i < len(S)-1:
        if S[i] != S[i+1] and floor_chart == 1:
            floor_chart = 0
            change_box.append(i)
        elif S[i] != S[i+1] and floor_chart == 0:
            floor_chart = 1
        i += 1

#    print(change_box)
    ans = [0]*len(S)
    for i in range(len(S)):
        if S[i] == 'R':
            pidx = pivot_index(change_box, i, 0)
            cool = pidx - i
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx+1] += 1

        else:
            pidx = pivot_index(change_box, i, 1)+1
            cool = i - pidx
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx-1] += 1
    print(ans[0], end='')
    for i in range(1, len(ans)):
        print(" {}".format(ans[i]), end='')
    print()


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-08-18 14:44:25 +0900
# LastModified: 2020-09-11 15:35:56 +0900
#


import os
import sys


def pivot_index(change_box, i, which):
    if which == 0:
        for cb in change_box:
            if cb >= i:
                return cb
    else:
        for j in range(len(change_box)-1, -1, -1):
            if change_box[j] <= i:
                return change_box[j]


def main():
    S = input()
    change_box = []
    floor_chart = 1
    i = 0
    while i < len(S)-1:
        if S[i] != S[i+1] and floor_chart == 1:
            floor_chart = 0
            change_box.append(i)
        elif S[i] != S[i+1] and floor_chart == 0:
            floor_chart = 1
        i += 1

    ans = [0]*len(S)
    one_cool = 0
    hash_one = 0
    for i in range(len(S)):
        if S[i] == 'R':
            if hash_one == 1:
                hash_one = 0
                one_cool += 1
            pidx = change_box[one_cool]
            cool = pidx - i
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx+1] += 1

        else:
            pidx = change_box[one_cool]+1
            hash_one = 1
            cool = i - pidx
            if cool % 2 == 0:
                ans[pidx] += 1
            else:
                ans[pidx-1] += 1
    print(ans[0], end='')
    for i in range(1, len(ans)):
        print(" {}".format(ans[i]), end='')
    print()


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N = int(input())
S = input()

ans = []
a = ['{:0=3}'.format(i) for i in range(1000)]

for key in a:
    a_loc = 0
    for i in range(N):
        if key[a_loc] == S[i]:
            if a_loc == 2:
                ans.append(key)
                break
            else:
                a_loc += 1
                
print(len(ans))
        



### FIXED CODE ###

n=int(input())
s=input()

ans=0

for i in range(10):
	a=s.find(str(i))
	if a == -1:
		continue
	else:
		for j in range(10):
			b=s.find(str(j),a+1)
			if b==-1:
				continue
			else:
				for k in range(10):
					c=s.find(str(k),b+1)
					if c==-1:
						continue
					else:
						ans+=1
						
print(ans)
### BUGGY CODE ###

def xor(a, b):
    ret = a
    for i in range(a+1, b+1):
        ret ^= i
    return ret


def xor_world(A, B):
    if A == B:
        return A

    if B < 8:
        return xor(A, B)

    n = 4
    while n < A:
        n <<= 1

    left = n

    while n <= B:
        n <<= 1

    right = (n >> 1) - 1

    if not (left < right):
        return xor(A, B)

    return xor(xor(A, left-1), xor(right+1, B))


if __name__ == "__main__":
    A, B = map(int, input().split())
    print(xor_world(A, B))

### FIXED CODE ###

def xor_world(A, B):
    if A == 0:
        m  = (B+1) // 2
        pre = 0 if m % 2 == 0 else 1
        if B % 2 == 1: 
            return pre 
        else:
            return pre ^ B
            
    else:   
        return xor_world(0, A-1) ^ xor_world(0, B)
        
        
if __name__ == "__main__":
    A, B = map(int, input().split())
    print(xor_world(A, B))
### BUGGY CODE ###

from itertools import groupby
from statistics import median
from time import time
from sys import exit
import numpy as np

N = int(input())

line = ([(index, v) for index, v in enumerate(input())])


def types(line): return line[1]
def index(line): return line[0]


gp = groupby(sorted(line, key=types), types)

d = {}

for k, v in gp:
    indexes = np.array([i for i, value in v])
    d[k] = indexes

if 'R' not in d or 'G' not in d or 'B' not in d:
    print(0)
    exit()

delete = 0

for differ in range(1, N):
    for start in range(N):
        if start + differ*2 > N - 1:
            break
        i = line[start]
        j = line[start + differ]
        k = line[start + differ*2]

        if len({i[1], j[1], k[1]}) == 3:
            upper = max(i[0], j[0], k[0])
            lower = min(i[0], j[0], k[0])
            median_num = median([i[0], j[0], k[0]])
            if upper - median_num == median_num - lower:
                delete += 1

print(d['R'].size * d['G'].size * d['B'].size - delete)


### FIXED CODE ###

from itertools import groupby
from statistics import median
from sys import exit

N = int(input())

line = ([(index, v) for index, v in enumerate(input())])


def types(line): return line[1]
def index(line): return line[0]


gp = groupby(sorted(line, key=types), types)

d = {}

for k, v in gp:
    indexes = set([i for i, value in v])
    d[k] = indexes

if 'R' not in d or 'G' not in d or 'B' not in d:
    print(0)
    exit()

delete = 0


for differ in range(1, N):
    for start in range(N):
        if start + differ*2 > N - 1:
            break

        i = line[start]
        j = line[start + differ]
        k = line[start + differ*2]

        if len({i[1], j[1], k[1]}) != 3:
            continue

        upper = max(i[0], j[0], k[0])
        lower = min(i[0], j[0], k[0])
        median_num = median([i[0], j[0], k[0]])
        if upper - median_num == median_num - lower:
            delete += 1

print(len(d['R']) * len(d['G']) * len(d['B']) - delete)
### BUGGY CODE ###

def gcd(a,b):
    if b > a:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a
N = int(input())
T = list(map(int,input().split()))
T.sort()
ANSLF = []
for i in range(len(T)):
    S = []
    for j in range(len(T)):
        S.append(T[j])
    S.pop(i)
    ANSL = [S[0]]
    for k in range(len(S)-1):
        ANSL.append(gcd(ANSL[k],S[k+1]))
    ANSLF.append(min(ANSL))
print(max(ANSLF))

### FIXED CODE ###

import copy 

def gcd(a,b):
    if b > a:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a

N = int(input())
T = list(map(int,input().split()))
T.sort()
LIS = [0]*N
LIS[0] += T[0]
for i in range(N-1):
    LIS[i+1] += gcd(LIS[i],T[i+1])
F = LIS.index(min(LIS))
if len(T) == 2:
    ANS = max(T[0],T[1])
elif F == 0:
    U = copy.copy(T)
    V = copy.copy(T)
    U.pop(1)
    V.pop(0)
    LU = [0]*(N-1)
    LU[0] = U[0]
    LV = [0]*(N-1)
    LV[0] = V[0]
    for i in range(N-2):
        LU[i+1] += gcd(LU[i],U[i+1])
    ANSU = LU[N-2]
    for i in range(N-2):
        LV[i+1] += gcd(LV[i],V[i+1])
    ANSV = LV[N-2]
    ANS = max(ANSU,ANSV)
    
else:
    U = copy.copy(T)
    V = copy.copy(T)
    U.pop(F)
    V.pop(0)
    LU = [0]*(N-1)
    LU[0] = U[0]
    LV = [0]*(N-1)
    LV[0] = V[0]
    ANSU = 0
    ANSV = 0
    for i in range(N-2):
        LU[i+1] += gcd(LU[i],U[i+1])
    ANSU = LU[N-2]
    for i in range(N-2):
        LV[i+1] += gcd(LV[i],V[i+1])
    ANSV = LV[N-2]
    ANSP = max(ANSU,ANSV)
    ANS = max(ANSP,LIS[N-1])
        
print(ANS)
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]

for i in range(1, n+1):
    x = a.count(i)
    print(x)

### FIXED CODE ###

import collections
n = int(input())
a = [int(i) for i in input().split()]
cnt = collections.Counter(a)

for i in range(1, n+1):
    print(cnt[i])
### BUGGY CODE ###

N = int(input())
A = []
for n in range(N):
    A.append(int(input()))
B = [max(A[: n+1]) for n in range(N)]
C = [max(A[N - n - 1:]) for n in range(N)][::-1]
D = [C[1]]+[max(B[n-1], C[n+1]) for n in range(1, N-2+1)]+[B[N-2]]
for d in D:
    print(d)


### FIXED CODE ###

N = int(input())
A = []
for n in range(N):
    A.append(int(input()))
B = [0 for n in range(N)]
B[0] = A[0]
for n in range(N-1):
    B[n+1] = max(B[n], A[n + 1])
C = [0 for n in range(N)]
C[-1] = A[-1]
for n in range(N - 1):
    C[-n-2] = max(C[-n-1], A[-n - 2])
for n in range(N):
    if n == 0:
        print(C[1])
    elif n == N - 1:
        print(B[N - 2])
    else:
        print(max(B[n-1], C[n+1]))
### BUGGY CODE ###

N, M = map(int, input().split())
v = [[] for _ in range(N)]
for i in range(M) :
    s, t = map(int, input().split())
    v[s-1].append(t-1)

# 削除しないでdp
dp = [0] * N
for i in range(N - 1, -1, -1) :
    if len(v[i]) == 0 :
        continue
   
    s = [dp[j] for j in v[i]]
    dp[i] = 1 + sum(s) / len(v[i])
    
ret = dp[0]

# 削除してdp
for i in range(N) :
    if len(v[i]) == 1 :
        continue
        
    dp = [0] * N
    for j in range(N - 1, -1, -1) :
        if len(v[j]) == 0 :
            continue
            
        s = [dp[k] for k in v[j]]
        if j == i :
            if len(v[j]) != 1 :
                dp[j] = 1 + (sum(s) - max(s)) / (len(v[j]) - 1)
        else :
            dp[j] = 1 + sum(s) / len(v[j])
        
    ret = min(ret, dp[0])
print(ret)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
v = [[] for _ in range(N)]
for i in range(M) :
    s, t = map(int, input().split())
    v[s-1].append(t-1)

# 削除しないでdp
dp = [0] * N
for i in range(N - 1, -1, -1) :
    if len(v[i]) == 0 :
        continue
    
    for j in v[i] :
        dp[i] += dp[j]
    dp[i] = 1 + dp[i] / len(v[i])
    
ret = dp[0]
# 削除してdp
for i in range(N - 1) :
    if len(v[i]) <= 1 :
        continue
        
    dp[i] = 0
    M = -1
    for j in v[i] :
        dp[i] += dp[j]
        M = max(M, dp[j])
    dp[i] = 1 + (dp[i] - M) / (len(v[i]) - 1)
    
    for j in range(i - 1, -1, -1) :
        if len(v[j]) == 0 :
            continue
            
        dp[j] = 0
        for k in v[j] :
            dp[j] += dp[k]
        dp[j] = 1 + dp[j] / len(v[j])
    
    ret = min(ret, dp[0])

print(ret)
### BUGGY CODE ###

import sys
import heapq

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

    h=[]
    for i in range(n):
        if b[i]>a[i]:
            heapq.heappush(h,[b[i]*-1,i])

    loop=0
    idx=0
    while(1):
    #print(b)
        if not h:
            break
        buf,idx=heapq.heappop(h)
        buf=-1*buf

        x=(buf-a[idx])//(b[(idx-1)%n]+b[(idx+1)%n])
        buf-=x*(b[(idx-1)%n]+b[(idx+1)%n])
        loop+=x
        b[idx]=buf
        if x==0:
            #print(b)
            print(-1)
            sys.exit()
        elif buf>a[idx]:
            heapq.heappush(h,[buf*-1,idx])

    print(loop)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import heapq

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

    h=[]
    for i in range(n):
        if b[i]>a[i]:
            heapq.heappush(h,(b[i]*-1,i))

    loop=0
    idx=0
    while(1):
    #print(b)
        if not h:
            break
        buf,idx=heapq.heappop(h)
        buf=-1*buf

        x=(buf-a[idx])//(b[(idx-1)%n]+b[(idx+1)%n])
        buf-=x*(b[(idx-1)%n]+b[(idx+1)%n])
        loop+=x
        b[idx]=buf
        if x==0:
            #print(b)
            print(-1)
            sys.exit()
        elif buf>a[idx]:
            heapq.heappush(h,(buf*-1,idx))

    print(loop)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

N=int(input())
L=[]
for i in range(N):
  A=int(input())
  if A in L:
    L.remove(A)
  else:
    L.append(A)
print(len(L))

### FIXED CODE ###

n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))
### BUGGY CODE ###

import numpy as np

D = int(input())
c = np.array(list(map(int, input().split())))
s = np.array([list(map(int, input().split())) for _ in range(D)])


def score(D, c, s, t):
    score = 0

    last_date = np.zeros(26)

    for di in range(1, D + 1):
        score += s[di - 1][t[di - 1]]

        last_date[t[di - 1]] = di

        for i in range(26):
            score -= c[i - 1] * (di - last_date[i - 1])

    return int(score)


def f4(D, c, s):
    t = np.zeros(D, dtype=int)
    for di in range(1, D + 1):
        current_score = score(D, c, s, t)
        for i in range(26):
            tmp = np.copy(t)
            tmp[di - 1] = i
            tmp_score = score(D, c, s, tmp)
            if current_score < tmp_score:
                current_score = tmp_score
                t = tmp
    return t


for ti in f4(D, c, s):
    print(ti + 1)

### FIXED CODE ###

import numpy as np

D = int(input())
c = np.array(list(map(int, input().split())))
s = np.array([list(map(int, input().split())) for _ in range(D)])

for si in s:
    print(np.where(si==max(si))[0][0].tolist() + 1)
### BUGGY CODE ###

n, a, b = map(int, input().split())
mod = int(1e+9) + 7
def extgcd(a, b):
  if b == 0:
    return 1, 0
  else:
    x, y, u, v, k, l = 1, 0, 0, 1, a, b
    while l != 0:
      x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
      k, l = l, k % l
    return x
def inved(x):
  a = extgcd(x, mod)
  return a % mod
def doubling(N, M):
  y = 1
  base = N
  while M != 0:
    if M % 2 == 1:
      y *= base
      y %= mod
    base *= base
    base %= mod
    M //= 2
  return y

A = doubling(2, n)
A = (A - 1) % mod
proda, prodb = 1, 1
for i in range(a):
  proda *= ((n - i) * inved(i + 1)) % mod
  proda %= mod
for i in range(b):
  prodb *= ((n - i) * inved(i + 1)) % mod
  prodb %= mod
print((A - proda - prodb) % mod)

### FIXED CODE ###

n, a, b = map(int, input().split())
mod = int(1e+9) + 7
def extgcd(a, b):
  if b == 0:
    return 1, 0
  else:
    x, y, u, v, k, l = 1, 0, 0, 1, a, b
    while l != 0:
      x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
      k, l = l, k % l
    return x
def inved(x):
  a = extgcd(x, mod)
  return a % mod
def doubling(N, M):
  y = 1
  base = N
  while M != 0:
    if M % 2 == 1:
      y *= base
      y %= mod
    base *= base
    base %= mod
    M //= 2
  return y
S = [inved(i+1) for i in range(b)]
A = doubling(2, n)
A = (A - 1) % mod
proda, prodb = 1, 1
for i in range(a):
  proda *= ((n - i) * S[i]) % mod
  proda %= mod
for i in range(b):
  prodb *= ((n - i) * S[i]) % mod
  prodb %= mod
print((A - proda - prodb) % mod)
### BUGGY CODE ###

N = int(input())
H = list(map(int,input().split()))
kekka = 'Yes'
for i in range(1,N):
    if max(H[0:i]) - 1 > H[i]:
        kekka = 'No'
print(kekka)

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
kekka='Yes'
maxx = 0
for i in range(N):
    if H[i] < maxx -1:
        kekka = 'No'
        break
    else:
        maxx = max(H[i],maxx)
print(kekka)
### BUGGY CODE ###

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

L = sorted(L)
ans = 0
H = {}
for i in range(N-1):
    for j in range(i+1, N-1):
        H.update({(i,j): L[i]+L[j]})


for h, v in H.items():
    for j in range(h[1]+1, N):
#        if h[0] == j or h[1] == j: continue
        if v > L[j]:
            ans += 1
        else: break

print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
import bisect
N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(len(L)):
    for j in range(i+1, len(L)):
        b_i = bisect.bisect_left(L, L[i]+L[j]) # a+bより小さい数
        ans += b_i - (j+1)
print(ans)