Harryxun/stf_run huggingface dataset:
n=int(input())
da={}
db={}
xy=[]
for _ in range(n):
    xy.append(list(map(int,input().split())))

for i in range(n):
    usedx=[]
    usedy=[]
    x1,y1=xy[i]
    for j in range(n):
        if i==j:
            continue
        x,y=xy[j]

        if x-x1 not in usedx and x-x1!=0:
            if x-x1 not in da:
                da[x-x1]=1
            else:
                da[x-x1]=da[x-x1]+1
            usedx.append(x-x1)

        if y-y1 not in usedy and y-y1!=0:
            if y-y1 not in db:
                db[y-y1]=1
            else:
                db[y-y1]=db[y-y1]+1
            usedy.append(y-y1)
print(n-min(max(da.values()),max(db.values())))


### FIXED CODE ###

n=int(input())
xy=[tuple(map(int,input().split())) for _ in range(n)]
pq=[]
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        sx,sy=xy[i]
        gx,gy=xy[j]
        pq.append((gx-sx,gy-sy))


se=set(xy)

ans=n
for p,q in pq:
    now=0
    for x,y in xy:
        if (x+p,y+q) not in se:
            now+=1
    ans=min(ans,now)

print(ans)
import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # input()
    A,B,N=map(int, input().split())

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    max=0
    max_x=0
    reg=[0]*10

    for x in range(N+1):
        rem = x%B
        if reg[rem]==1:
            break
        else:
            reg[rem]=1
        if rem > max:
            rem = max
            max_x=x

    # min,_=math.modf(max_x/B)

    print(int(A*max_x/B)-A*int(max_x/B))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
   # file_input()
    # input()
    A,B,N=map(int, input().split())

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    # max=0
    # max_x=0
    # first=0
    #
    # for x in range(N+1):
    #     rem = x%B
    #     if x == 0:
    #         first=rem
    #     elif rem == first:
    #         break
    #     if rem > max:
    #         max=rem
    #         max_x=x

    if N<B:
        max_x=N
    else:
        max_x=B-1

    # min,_=math.modf(max_x/B)

    print(int(A*max_x/B)-A*int(max_x/B))

if __name__ == '__main__':
    main()
k,x= int(raw_input()), int(raw_input())

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

### FIXED CODE ###

k,x = [int(x) for x in input().split()]

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")
import math

N , K = map(int, input().split())
flag = "F"

while 1:
    lenN = int (math.log10(N) + 1)
    lenK = int (math.log10(K) + 1)
    N = abs(N-K*(10**abs(lenN-lenK-1)))
    lenN = int (math.log10(N) + 1)
    if abs(lenN-lenK)<2:
        break
        
while 1:
    
    
    a = N
    N = abs(N - K)
    

    if a<=K and N <= K:
        if a < N:
            result = a
            flag="T"
        else:
            result = N
            flag="T"
    if flag == "T":
        break
print(result)

### FIXED CODE ###

import math

N , K = map(int, input().split())
flag = "F"
if N !=0:
    while 1:
        lenN = int (math.log10(N) + 1)
        lenK = int (math.log10(K) + 1)
        N = abs(N-K*(10**abs(lenN-lenK-1)))
        lenN = int (math.log10(N) + 1)
        if abs(lenN-lenK)<2:
            break



        
while 1:
    
    
    a = N
    N = abs(N - K)
    

    if a<=K and N <= K:
        if a < N:
            result = a
            flag="T"
        else:
            result = N
            flag="T"
    if flag == "T":
        break
print(result)
S = list(str(input()))
if S[0]==S[1]==S[2]==S[3]:
    print('No')
elif (S[0]==S[1]) and (S[2]==S[3]):
    print('Yes')
elif (S[0]==S[2]) and (S[1]==S[3]):
    print('Yes')
elif (S[0]==S[3]) and (S[1]==S[2]):
    print('Yes')
else:

### FIXED CODE ###

S = list(str(input()))
if (S[0]==S[1]) and (S[0]==S[2]) and (S[0]==S[3]):
    print('No')
elif (S[0]==S[1]) and (S[2]==S[3]):
    print('Yes')
elif (S[0]==S[2]) and (S[1]==S[3]):
    print('Yes')
elif (S[0]==S[3]) and (S[1]==S[2]):
    print('Yes')
else:
    print('No')
S = input().strip()
dp = [[INFTY for _ in range(2)] for _ in range(len(S))]
for k in range(10):
    n = int(S[-1])
    if k>= n:
        dp[0][0] = min(dp[0][0],2*k-n)
    else:
        dp[0][1] = min(dp[0][1],2*k-n+10)
for i in range(1,len(S)):
    n = int(S[-(1+i)])
    for k in range(10):
        if k>n:
            dp[i][0] = min(dp[i][0],2*k-n+dp[i-1][0],k+(k-1)-n+dp[i-1][1])
        elif k==n:
            dp[i][0] = min(dp[i][0],2*k-n+dp[i-1][0])
            if n==0:
                dp[i][1] = min(dp[i][1],k+(k-1)%10-n+dp[i-1][1])
            else:
                dp[i][1] = min(dp[i][1],k+10-n+k-1+dp[i-1][1])
        elif k<n:
            dp[i][1] = min(dp[i][1],k+10-n+k+dp[i-1][0],k+10-n+k-1+dp[i-1][1])
print(min(dp[len(S)-1][0],dp[len(S)-1][1]+1))

### FIXED CODE ###

S = input().strip()
INFTY=10**8
dp = [[INFTY for _ in range(2)] for _ in range(len(S))]
for k in range(10):
    n = int(S[-1])
    if k>= n:
        dp[0][0] = min(dp[0][0],2*k-n)
    else:
        dp[0][1] = min(dp[0][1],2*k-n+10)
for i in range(1,len(S)):
    n = int(S[-(1+i)])
    for k in range(10):
        if k>n:
            dp[i][0] = min(dp[i][0],2*k-n+dp[i-1][0],k+(k-1)-n+dp[i-1][1])
        elif k==n:
            dp[i][0] = min(dp[i][0],2*k-n+dp[i-1][0])
            if n==0:
                dp[i][1] = min(dp[i][1],k+(k-1)%10-n+dp[i-1][1])
            else:
                dp[i][1] = min(dp[i][1],k+10-n+k-1+dp[i-1][1])
        elif k<n:
            dp[i][1] = min(dp[i][1],k+10-n+k+dp[i-1][0],k+10-n+k-1+dp[i-1][1])
print(min(dp[len(S)-1][0],dp[len(S)-1][1]+1))
a,b,c,d = map(int, input().split())
count = 0

#最大公約数
def gcd(a,b):
    while b!=0:
        a,b = b,a%b
    return a
 #最小公倍数
def lcm(a,b):
    return a*b // gcd(a,b)

gcd_num = lcm(c,d)

def calc_num(n, C, D):
    """
    0~Nまでで、C or Dで割り切れない数の個数
    """
    div_C = n//C
    div_D = n//D
    div_CD = n//(lcm(C, D))
    return n-div_C-div_D+div_CD


def solve():
    A, B, C, D = map(int, input().split())
    return calc_num(B, C, D)-calc_num(A-1, C, D)

print(solve())

### FIXED CODE ###

#最大公約数
def gcd(a,b):
    while b!=0:
        a,b = b,a%b
    return a
 #最小公倍数
def lcm(a,b):
    return a*b // gcd(a,b)

def calc_num(n, C, D):
    """
    0~Nまでで、C or Dで割り切れない数の個数
    """
    div_C = n//C
    div_D = n//D
    div_CD = n//(lcm(C, D))
    return n-div_C-div_D+div_CD


def solve():
    A, B, C, D = map(int, input().split())
    return calc_num(B, C, D)-calc_num(A-1, C, D)

print(solve())
n = list(input())
k = int(input())
if len(n) == 1:
    print(int(n[0]))
    exit()
for i in range(len(n)):
    if n[i] != "1":
        x = i
        break
if i+1 > k:
    print(1)
    exit()
else:
    print(n[x])


### FIXED CODE ###

n = list(input())
k = int(input())
if len(n) == 1:
    print(int(n[0]))
    exit()
x = 0
for i in range(len(n)):
    if n[i] != "1":
        x = i
        break
if x+1 > k:
    print(1)
    exit()
else:
    print(n[x])
a,b = map(int,input().split())
if (a + b)%2 = 0:
    print((a+b)/2)
else:
    print("impossible") 
    

### FIXED CODE ###

a,b = map(int,input().split())
if (a + b)%2 == 0 :
    print(round((a+b)/2))
else:
    print("IMPOSSIBLE")
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

al = inpl()
bl = intp()
ans = 0
for i in range(0, 3):
    if(al[i] == bl[i]):
        ans += 1
print(ans)

### FIXED CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

al = input()
bl = input()
ans = 0
for i in range(0, 3):
    if(al[i] == bl[i]):
        ans += 1
print(ans)
mport math

N, D = map(int, input().split())
X = [list(map(int, input().split())) for i in range(N)]

cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        dis = 0
        for d in range(D):
            dis += (X[i][d] - X[j][d])**2
        if math.sqrt(dis) == int(math.sqrt(dis)):
            cnt += 1

print(cnt)

### FIXED CODE ###

import math

N, D = map(int, input().split())
X = [list(map(int, input().split())) for i in range(N)]

cnt = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        dis = 0
        for d in range(D):
            dis += (X[i][d] - X[j][d])**2
        if math.sqrt(dis) == int(math.sqrt(dis)):
            cnt += 1
print(cnt)
n=int(input())
for i in range(n):
  m, curr=map(float, input().split())
  a=0
  if curr='BTC'
    a=a+m/380000
  else:
    a=a+m
print(a)

### FIXED CODE ###

n=int(input())
a=0
for i in range(n):
  m, curr=input().split()
  m=float(m)
  curr=str(curr)
  if curr=='BTC':
    a=a+m*380000
  else:
    a=a+m
print(a)
import sys
a = sys.stdin.read().split('\n')[:-1]
s = list(a[0])
q = int(a[1])
f = 1
for i in range(2, q + 2):
    if a[i][0] == '1':
        f = 1 - f
    else:
        l = len(s)
        s.insert(a[i][2] == '21'[f] ? 0 : l, a[i][4])
if f == 1:
    print(''.join(s))
else:
    print(''.join(reversed(s)))

### FIXED CODE ###

import sys
a = sys.stdin.read().split('\n')[:-1]
q = int(a[1])
f = 1
l = [[], []]
for i in range(2, q + 2):
    if a[i][0] == '1':
        f = 1 - f
    else:
        l[0 if a[i][2] == '21'[f] else 1].append(a[i][4])
if f != 1:
    l[1].reverse()
    print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0]))
else:
    l[0].reverse()
    print(''.join(l[0]) + a[0] + ''.join(l[1]))
N = input()
N = int(N)
S = [int(input()) for _ in range(N)]
result = 0

while onon < N:
    result += 1
    hoge = S.pop(0)
    onon = 0
    for j in range(len(S)):
        if S[onon] > hoge:
            S.pop(onon)
        else:
            onon + 1
print(result)

### FIXED CODE ###

import bisect

N = input()
N = int(N)
S = [-int(input()) for _ in range(N)]
result = []

for i in range(N):
    hoge = bisect.bisect(result,S[i])
    if hoge == len(result):
        result.append(S[i])
    else:
        result[hoge] = S[i]
print(len(result))
import math
#負けを考える

n, k = map(int, input().split())
h = math.floor(math.log2(k-1))

p = 0

s = [k-1]
for i in range(h):
    s.append(math.floor((k-1) / (2**(i+1))))
s = s[::-1]
t = [s[0]]
for j in range(h):
    t.append(s[j+1] - s[j])

t = t[::-1]
for i in range(len(t)):
    p += t[i] * ((1/2)**(i+1)) * (1/n)

p += (n+1-k)/n

print(p)





### FIXED CODE ###

n, k = map(int, input().split())

ans = 0

for i in range(1,n+1):
    t = 1
    while i * t < k:
        t *= 2
    ans += 1 / t

print(ans / n)
N = int(input())
S = int(input())
if S[0:N/2] * 2 = S:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N = int(input())
S = str(input())
if S[0:N//2] * 2 == S:
    print("Yes")
else:
    print("No")
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7

N, K = map(int, input().split())
R = N-K

for i in range(1, K+1):
    if i > R+1:
        print(0)
    else:
        ans = cmb(R+1, i, mod) * cmb(K-1, i-1, mod) % mod
        print(ans)




### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
N = 10**4
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


N, K = map(int, input().split())
R = N-K

for i in range(1, K+1):
    if i > R+1:
        print(0)
    else:
        ans = cmb(R+1, i, mod) * cmb(K-1, i-1, mod) % mod
        print(ans)
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
  	if S[i] == ("L" or "U" or "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")


### FIXED CODE ###

S = list(input())
for i in range(len(S)):
	if i % 2 == 0:
		if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
	else:
		if (S[i] == "L") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
print("Yes")
# -*- coding: utf-8 -*-

def qui(l):
    num = len(l)
    if num == 0: return []
    piv = l[0]
    mini = []
    maxi = []
    for i in range(1,len(l)):
        if piv > l[i]:
            mini.append(l[i])
        elif piv <= l[i]:
            maxi.append(l[i])
    return qui(mini) + [piv] + qui(maxi)

input()
list1 = list(map(lambda x: int(x), input().split(" ")))
result = qui(list1)

print(' '.join(map(str, result)))

### FIXED CODE ###

# -*- coding: utf-8 -*-

import random
def qui(l):
    num = len(l)
    if num <= 1:
        return l
    piv = random.randrange(0,len(l))
    piv2 = random.randrange(0,len(l))
    piv3 = random.randrange(0,len(l))
    if (l[piv] > l[piv2]) and (l[piv2] > l[piv3]):
        piv = piv2
    elif (l[piv] > l[piv3]) and (l[piv3] > l[piv2]):
        piv = piv3
    elif (l[piv] < l[piv2]) and (l[piv2] < l[piv3]):
        piv = piv2
    elif (l[piv] < l[piv3]) and (l[piv3] < l[piv2]):
        piv = piv3
    else:
        pass
    mini = []
    middlei = []
    maxi = []

    for i in range(0,len(l)):
        if l[i] == l[piv]:
            middlei.append(l[i])
        elif l[piv] > l[i]:
            mini.append(l[i])
        elif l[piv] <= l[i]:
            maxi.append(l[i])
    mini = qui(mini)
    maxi = qui(maxi)
    return mini+ middlei+maxi
input()
list1 = input().split(" ")
for i in range(0, len(list1)):
    list1[i] = int(list1[i])

result = qui(list1)

print(' '.join(map(str, result)))
import math

a,b=map(int,input().split())
print(int(a*b/math.gcd(a,b)))

### FIXED CODE ###


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

a,b=map(int,input().split())
print(int(a*b/gcd(a,b)))
N, K = map(int, input().split())
S = str(input())
S_list = []
cum_list = [0]
tmp = 1
count = 0
if "0" not in S or "1" not in S:
    print(len(S))

else:
    for i in range(N):
        if i == 0:
            if int(S[i]) == tmp:
                count += 1
            else:
                S_list.append(count)
                count = 1
        else:
            if S[i] == S[i - 1]:
                count += 1
                if i == N - 1:
                    S_list.append(count)
            else:
                S_list.append(count)
                count = 1


    if S[-1] == "0":
        S_list.append(0)




    now = 0
    for i in range(len(S_list)):
        now += S_list[i]
        cum_list.append(now)
    def check(x,K):
        answer_list = []
        i = 0
        if i + 2 * K + 1 < len(x):
            while i + 2 * K + 1 < len(x):
                answer_list.append(x[i + 2 * K + 1] - x[i])
                i += 2
            return answer_list
        elif K > 0:
            check(x,K-1)
    answer_list = check(cum_list,K)

    answer = max(answer_list)
    print(answer)

### FIXED CODE ###

N, K = map(int, input().split())
S = str(input())
S_list = []
cum_list = [0]
tmp = 1
count = 0

for i in range(N):
    if i == 0:
        if int(S[i]) == tmp:
             count += 1
        else:
            S_list.append(count)
            count = 1
    else:
        if S[i] == S[i - 1]:
            count += 1
            
        else:
            S_list.append(count)
            count = 1

S_list.append(count)
if S[-1] == "0":
    S_list.append(0)


now = 0
for i in range(len(S_list)):
    now += S_list[i]
    cum_list.append(now)


answer_list = []
i = 0
if 2 * K + 1 < len(cum_list):
    while i + 2 * K + 1 < len(cum_list):
        answer_list.append(cum_list[i + 2 * K + 1] - cum_list[i])
        i += 2
else:
    answer_list.append(len(S))
answer = max(answer_list)
print(answer)
n = int(input())
a = list(map(float, input().split()))

for i in a:
	sum += i 
	double = i ** 2
print((sum**2-double)/2)

### FIXED CODE ###

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

if (a <= b * 2):
  print (0)
else:
  print (a - b * 2)
X, K, D = map(int,input().split())
absX = abs(X)
t = abs(X // D)
remain_K = K - t
l = X % D
if remain_K < 0:
    a = abs(X - (K * D))
    b = abs(X + (K * D))
else:
    if remain_K % 2 == 0:
        a = abs(l - (D * 2))
        b = abs(l + (D * 2))
        if a < b and a < l:
            ans = a
        elif a > b and b < l:
            ans = b
        else:
            ans = l
    else:
        a = abs(l - D)
        b = abs(l + D)
        if a < b:
            ans = a
        else:
            ans = b
print(ans)


### FIXED CODE ###

X, K, D = map(int,input().split())
absX = abs(X)
t = abs(X // D)
remain_K = K - t
l = X % D
if remain_K < 0:
    a = abs(X - (K * D))
    b = abs(X + (K * D))
    if a < b:
        ans = a
    else:
        ans = b
else:
    if remain_K % 2 == 0:
        a = abs(l - (D * 2))
        b = abs(l + (D * 2))
        if a < b and a < l:
            ans = a
        elif a > b and b < l:
            ans = b
        else:
            ans = l
    else:
        a = abs(l - D)
        b = abs(l + D)
        if a < b:
            ans = a
        else:
            ans = b
print(ans)
K = int(input())

n = 1
x = 7


if K % 2 == 0:
  peint( -1 )
  exit( 0 )
#

while 1:
  if x % K == 0:
    print( n )
    break
  x = (x % K) * 10 + 7
  n += 1
#


### FIXED CODE ###

K = int(input())

n = 1
x = 7


if (K % 2 == 0)or(K % 5 == 0):
  print( -1 )
  exit( 0 )
#

while 1:
  if x % K == 0:
    print( n )
    break
  x = (x * 10 + 7) % K
  n += 1
#
# ABC066C - pushpush (ARC077)
def main():
    N, *A = map(int, open(0).read().split())
    if int(N) & 1:
        B = A[::2][::-1] + A[1::2]
    else:
        B = A[1::2][::-1] + A[::2]
    print(" ".join(B))


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC066C - pushpush (ARC077)
from collections import deque

n = int(input())
lst = list(map(int, input().rstrip().split()))
b = deque()
parity = n % 2
for i, j in enumerate(lst, start=1):
    if i % 2 == parity:
        b.appendleft(j)
    else:
        b.append(j)
print(*b)
import networkx as nx
def main():
    G=setup_graph()
    print_longest_path(G)
def setup_graph():
    G=nx.DiGraph()
    G.add_edges_from(tuple(tuple(list(map(int,input().split())))for _ in range(int(input().split()[1]))))
    return G
def print_longest_path(G):
    print(len(nx.dag_longest_path(G))-1)
if __name__=='__main__':
    main()

### FIXED CODE ###

from collections import defaultdict,deque
v,n=map(int,input().split())
es=[[int(x)for x in input().split()]for _ in range(n)]
outs=defaultdict(list)
ins=defaultdict(int)
for v1,v2 in es:
    outs[v1].append(v2)
    ins[v2]+=1
q=deque(v1 for v1 in range(v+1)if ins[v1]==0)
res=[]
p=[0]*-~v
while q:
    v1=q.popleft()
    res.append(v1)
    for v2 in outs[v1]:
        ins[v2]-=1
        if ins[v2]==0:
            q.append(v2)
            p[v2]=v1
dp=[0]*-~v
for i in res[1:]:
  dp[i]=dp[p[i]]+1
print(max(dp)-1)
def abc_list(c: int):
    a = -n + m / 5 + 4 * c / 5
    b = 2 * n + -m / 5 - 9 * c / 5

    if a >= 0 and b >= 0:
        return [int(a), int(b), c]

    else:
        return False


def judge(z):
    if z <= n:
        l = abc_list(z)

        if l == False or sum(l) != n:
            judge(z + 1)
        else:
            print(l[0], l[1], l[2])

    else:
        print(-1, -1, -1)


n, M = list(map(int, input().split(" ")))
m = int(M / 1000)

judge(0)


### FIXED CODE ###

def pay(i: int, remain: int, z: int):
    for i in range(0, (n - z) + 1):
        if 10 * i + 5 * (remain - i) + z == m:
            print(i, remain - i, z)
            exit()

    return


n, M = list(map(int, input().split(" ")))
m = int(M / 1000)

for z in range(n, -1, -1):
    pay(0, n - z, z)

print(-1, -1, -1)
H,W = map(int,input().split())

a = [input() for i in range(H)]

y = [False]*H
x = [False]*H

for i in range(H):
    for j in range(W):
        if a[i][j] == "#":
            y[i] == True
            x[j] == True
            
for i in range(H):
    if y[i] == True:
        for j in range(W):
            if x[j] == True:
                print(a[i][j],end="")
        print()

### FIXED CODE ###

H,W = map(int,input().split())
a = [input() for i in range(H)]

y = [False]*H
x = [False]*W

for i in range(H):
    for j in range(W):
        if a[i][j] == "#":
            y[i] = True
            x[j] = True
            
for i in range(H):
    if y[i] == True:
        for j in range(W):
            if x[j] == True:
                print(a[i][j],end="")
        print()
def func():

    n = int(input())
    data = []
    for i in range(n):
        data.append(list(map(int,input().split())))

    for cx in range(101):
        for cy in range(101):
            for line in data:
                x = line[0]
                y = line[1]
                h = line[2]
                disx = x-cx
                disy = y-cy
                h1 = h + abs(disx) + abs(disy)
                if not h1 in dict:
                    dict[h1] = 0
                else:
                    dict[h1] += 1
                if h == 0:
                    for i in range(h1):
                        if i == 0:
                            continue
                        if not h1 in dict:
                            dict[h1] = 0
                        else:
                            dict[h1] += 1

                for key in dict.keys():
                    if dict[key] == n-1:
                        print(cx,end=" ")
                        print(cy,end=" ")
                        print(key)
                        return 0

func()



### FIXED CODE ###



def func():

    n = int(input())
    data = []
    for i in range(n):
        data.append(list(map(int,input().split())))

    for cx in range(101):
        for cy in range(101):
            for line in data:
                if line[2] != 0:
                    x = line[0]
                    y = line[1]
                    h = line[2]
                    H_max = h + abs(cx - x) + abs(cy - y)
                    break
            flag = True
            for i in range(n):
                    x = data[i][0]
                    y = data[i][1]
                    h = data[i][2]
                    if h != 0:
                        if not H_max == h + abs(cx-x) + abs(cy-y):
                            flag = False
                            break
                    else:
                        if not H_max <=  abs(cx-x) + abs(cy-y):
                            flag = False
                            break
            if flag:
                print(cx,cy,H_max)
                return 0

func()