Harryxun/stf_run huggingface dataset:
N = int(input())
a = [int(n) for n in input().split()]
a = sorted(a)

colors = [0,0,0,0,0,0,0,0]
free = 0

for i in a:
    if i < 400:
        colors[0] = 1
    elif i < 800:
        colors[1] = 1
    elif i < 1200:
        colors[2] = 1
    elif i < 1600:
        colors[3] = 1
    elif i < 2000:
        colors[4] = 1
    elif i < 2400:
        colors[5] = 1
    elif i < 2800:
        colors[6] = 1
    elif i < 3200:
        colors[7] = 1
    else:
        free += 1

print(str(sum(colors)) + " " + str(min(sum(colors) + free, 8)))
N = int(input())
a = [int(n) for n in input().split()]
a = sorted(a)

colors = [0,0,0,0,0,0,0,0]
free = 0

for i in a:
    if i < 400:
        colors[0] = 1
    elif i < 800:
        colors[1] = 1
    elif i < 1200:
        colors[2] = 1
    elif i < 1600:
        colors[3] = 1
    elif i < 2000:
        colors[4] = 1
    elif i < 2400:
        colors[5] = 1
    elif i < 2800:
        colors[6] = 1
    elif i < 3200:
        colors[7] = 1
    else:
        free += 1

print(str(sum(colors)) + " " + str(min(sum(colors) + free, 8)))


### FIXED CODE ###

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

colors = [0,0,0,0,0,0,0,0]
free = 0

for i in a:
    if i < 400:
        colors[0] = 1
    elif i < 800:
        colors[1] = 1
    elif i < 1200:
        colors[2] = 1
    elif i < 1600:
        colors[3] = 1
    elif i < 2000:
        colors[4] = 1
    elif i < 2400:
        colors[5] = 1
    elif i < 2800:
        colors[6] = 1
    elif i < 3200:
        colors[7] = 1
    else:
        free += 1

s = sum(colors)

print(str(max(s, 1)) + " " + str(s + free))
n=int(input())
P=list(map(int,input().split()))
ans=0
if P[0]==1:
  P[0]=P[1]
  P[1]=1
  ans+=1
while True:
  flag=True
  for i in range(1,n):
    if P[i]==i+1:
      if P[i+1]!=i+2:
        P[i]=P[i+1]
        P[i+1]=i+1
      else:
        P[i]=P[i-1]
        P[i-1]=i+1
      ans+=1
      flag=False
  if flag==True:
    break
print(ans)

### FIXED CODE ###

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

ans=0
for i in range(n-1):
  if P[i]==i+1:
    P[i],P[i+1]=P[i+1],P[i]
    ans+=1
if P[-1]==n:
  ans+=1
print(ans)
while True:
    try:
        h = 0
        for i in range(8):
            tmp = raw_input()
            if tmp.count(1) = 0:
                a[h] = tmp
                h += 1
        if h == 1:
            print "C"
        elif h == 2:
            c = a[0].index(1) - a[1].index(1)
            if c == 0:
                print "A"
            elif c == -1:
                print "E"
            else:
                print "G"
        elif h == 3:
            c = a[0].index(1) - a[2].index(1)
            print "D" if c == 1 else "F"
        else:
            print "B"

    except:
        break

### FIXED CODE ###

while True:
    try:
        h = 0
        a=["","","",""]
        for i in range(8):
            tmp = raw_input()
            if int(tmp) != 0:
                a[h] = tmp
                h += 1
    	if h == 1:
            print "C"
        elif h == 2:
            c = a[0].index("1") - a[1].index("1")
            if c == 0:
                print "A"
            elif c == -1:
                print "E"
            else:
                print "G"
        elif h == 3:
            c = a[0].index("1") - a[2].index("1")
            print "D" if c == 1 else "F"
        else:
            print "B"
    	raw_input()
    except:
	break
import sys
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [0] * N
ans = []
flg = 0
flg2 = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
  str[s-1] = c
#  print('str = ')
#  print(str)
  one = int(str[0])
  if N == 3:
    ret = one*100 + int(str[1])*10 + int(str[2])
    if int(str[1])>0:
      flg = 1
    if int(str[2])>0:
      flg2 = 1
  elif N == 2:
    ret = one*10 + int(str[1])
    if int(str[1]) > 0:
      flg = 1
  else:
    if one > 0:
      ret = one
  ans.append(ret)

#print(ans)

for obj in ans[:]:
  if (obj / (10**(N-1))) < 1:
    ans.remove(obj)
    
  if N == 2:
    if flg == 1:
      a = obj % 10
      if a == 0:
#        print('リムーブ')
        ans.remove(obj)

  elif N == 3:
    if flg == 1 and flg2 ==1:
#      print('リムーブ候補')
#      print(obj)
      if obj % 100 == 0:
#        print('リムーブ')
        ans.remove(obj)
      elif obj % 10 == 0:
#        print('リムーブ')
        ans.remove(obj)
    elif flg == 0 and flg2 ==1:
#      print('リムーブ候補')
#      print(obj)
      b = obj % 10
      print(b)
      if b == 0:
#        print('リムーブ')
        ans.remove(obj)

if not ans:
  print('-1')
else:
#  print(ans)
  print(min(ans))


### FIXED CODE ###

import sys
import math
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])
#print(N)
#print(M)

#初期化
str = [10] * N
#print(str)

for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
#  print(str[s-1])
#  if str[s-1] > c:
  if str[s-1] == 10:
    str[s-1] = c
  elif(str[s-1] == c):
    #同じ値の場合は何もしない
    pass
  else:
    #既に何かしらの異なる値が入っている場合はエラー
    print('-1')
    sys.exit()

#print(str)
#str = [0 if i == 10 else i for i in str]
#print(str)
if N == 3:
  if str[0] == 10 and str[1] == 10:
    str[0] = 1
    str[1] = 0
  elif str[0] == 10 and str[1] != 10:
    str[0] = 1
  elif str[0] != 10 and str[1] == 10:
    str[1] = 0

  str[2] = 0 if str[2] == 10 else str[2]

  ret = (int(str[0])*100 + int(str[1])*10 + int(str[2])) if int(str[0]) > 0 else -1
elif N ==2:
  str[0] = 1 if str[0] == 10 else str[0]
  str[1] = 0 if str[1] == 10 else str[1]
  ret = (int(str[0])*10 + int(str[1])) if int(str[0]) > 0 else -1
elif N ==1:
  str[0] = 0 if str[0] == 10 else str[0]
  ret = int(str[0])

print(ret)
a,b,c,d=map(int, input().split())
answer=0

if a<c:
    if b>c:
        if b>d:
            answer=d-c
        else:
            answer=b-c
else:
    if d>a:
        if d>b:
            answer=b-aa
        else:
            answer=d-a
print(answer)

        

### FIXED CODE ###

a,b,c,d=map(int, input().split())
answer=0

if a<c:
    if b>c:
        if b>d:
            answer=d-c
        else:
            answer=b-c
else:
    if d>a:
        if d>b:
            answer=b-a
        else:
            answer=d-a
print(answer)
a,b,k=list(map(int ,input().split()))
l=[]
count=0
for i in range(1,max(a,b)):
	if(a%i==0 and b%i==0):
		l.append(i)
		
		
	
	else:
		count+=1

l.sort()
l.reverse()
if(l.empty()):
	
	print(0)
else:
	print(l[k-1])


### FIXED CODE ###

A,B,K=map(int,input().split())
ans=0
n=100
while True:
    if A%n==0 and B%n==0:
        ans+=1
        if ans==K:
            print(n)
            exit()
    n-=1
while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break

    for h in range(H):
        for w in range(W):
        if h == 0 or h == H - 1 or w == 0 or w == W - 1:
            print('#', end='')
        else:
            print('.', end='')

        print()

    print()

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break

    for h in range(H):
        for w in range(W):
            print('#', end='')

        print()

    print()
import bisect
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
mid = bisect.bisect_left(y,y[-1]/2)
if y[-1]/2-x[mid]>=x[mid+1]-y[-1]/2:print(y[-1],x[mid+1])
else:print(y[-1],x[mid])

### FIXED CODE ###

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

y = max(x)
sub = y
res = 0
for i in range(n):
    if abs(float(y/2-x[i])) < sub and x[i] != y:
        sub = abs(float(y/2-x[i]))
        res = x[i]

print(y,res)
ab= int,input().split()
print(ab[0]*ab[1])


### FIXED CODE ###

a, b = map(int, input().split())
print(a * b)
N,K=map(int, input().split())
sushi=sorted([tuple(map(int, input().split())) for _ in range(N)], key=lambda x: x[1], reverse=True)

ty = set()
im = []
mu = []
an = []

for t,d in sushi:
	if t in ty:
		if K > 0:
			mu.append(d)
			K -= 1
	else:
		ty.add(t)
		im.append(d)
		if K > 0:
			K -= 1
		else:
			mu.pop()

	an.append(len(ty)**2 + sum(im) + sum(mu))

print(max(an))


### FIXED CODE ###

N,K=map(int, input().split())
sushi=sorted([tuple(map(int, input().split())) for _ in range(N)], key=lambda x: x[1], reverse=True)

typ = set()
ans = 0
cur = 0
rem = []

for t,d in sushi:
	if t in typ:
		if K > 0:
			K -= 1
			cur += d
			rem.append(d)
	else:
		typ.add(t)
		cur += d
		if K > 0:
			K -= 1
		elif len(rem):
			cur -= rem.pop()
		else:
			break

	ans = max(ans, cur + len(typ)**2)

print(ans)
h,w = map(int,input().split())
grid = []
ans = []
for i in range(h):
    grid.append(list(map(int,input().split())))
cur = [0,0]
while cur[0] != h or (cur[1] != 0 and cur[1] != w-1):
    y,x = cur[0],cur[1]
    if y % 2 == 0:
        if x != w-1:
            if grid[y][x] % 2 == 1:
                grid[y][x] -= 1
                grid[y][x+1] += 1
                ans.append((y+1,x+1,y+1,x+2))
            cur[1] += 1
        else:
            if grid[y][x] % 2 == 1:
                grid[y][x] -= 1
                grid[y+1][x] += 1
                ans.append((y+1,x+1,y+2,x+1))
            cur[0] += 1
    else:
        if x != 0:
            if grid[y][x] % 2 == 1:
                grid[y][x] -= 1
                grid[y][x-1] += 1
                ans.append((y+1,x+1,y+1,x))
            cur[1] -= 1
        else:
            if grid[y][x] % 2 == 1:
                grid[y][x] -= 1
                grid[y+1][x] += 1
                ans.append((y+1,x+1,y+2,x+1))
            cur[0] += 1
for i in ans:
    print(i[0],i[1],i[2],i[3])

### FIXED CODE ###

h,w = map(int,input().split())
coins = []
ans = []
for i in range(h):
    coins.append(list(map(int,input().split())))
for i in range(h-1):
    for j in range(w):
        if coins[i][j] % 2 != 0:
            coins[i][j] -= 1
            coins[i+1][j] += 1
            ans.append((i+1,j+1,i+2,j+1))
for i in range(w-1):
    if coins[h-1][i] % 2 != 0:
        coins[h-1][i] -= 1
        coins[h-1][i+1] += 1
        ans.append((h,i+1,h,i+2))
print(len(ans))
for i in range(len(ans)):
    print(*ans[i])
def check(c,t):
    if len(c) < len(t):
        return False
    for i in range(len(t)):
        if c[i] != "?" and c[i] != t[i]:
            return False

    return True
        

i = 0 
Has = False
ans = ""
while i < len(s):
    if (s[i] == "?" or s[i] == t[0]) and not Has:
        if check(s[i:],t):
            Has = True
            ans += t
            i += len(t)
        else:
            if s[i] == "?":
                ans += "a"
            else:
                ans += s[i]
            i += 1

    elif s[i] == "?":
        i += 1
        ans += "a"
    else:
        ans += s[i]
        i += 1

if Has:
    print(ans[::-1])
else:
    print('UNRESTORABLE')

### FIXED CODE ###

s = input()[::-1]
t = input()[::-1]
 
def check(c,t):
    if len(c) < len(t):
        return False
    for i in range(len(t)):
        if c[i] != "?" and c[i] != t[i]:
            return False
 
    return True
        
 
i = 0 
Has = False
ans = ""
while i < len(s):
    if (s[i] == "?" or s[i] == t[0]) and not Has:
        if check(s[i:],t):
            Has = True
            ans += t
            i += len(t)
        else:
            if s[i] == "?":
                ans += "a"
            else:
                ans += s[i]
            i += 1
 
    elif s[i] == "?":
        i += 1
        ans += "a"
    else:
        ans += s[i]
        i += 1
 
if Has:
    print(ans[::-1])
else:
    print('UNRESTORABLE')
import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
 
def div_ceil(x, y): return (x + y - 1) // y
 
N, M = map(int, input().split())
*A, = map(int, input().split())
A = list(set([a // 2 for a in A]))
L = A[0]
for a in A[1:]:
    L *= a // gcd(L, a)
for a in A:
    if (L // a) % 2 == 0:
        ans = 0
        break
else:
    ans = div_ceil(M // L, 2)
print(ans)
import math

def lcm(x,y):
    return x*y // math.gcd(x,y)


a,b,c,d = map(int,input().split(' '))
not_a_1 =0
not_b = 0
not_b =  b-(b//c)-(b//d)+(b//lcm(c,d))
not_a_1 = a-1-((a-1)//c)-((a-1)//d)+((a-1)//lcm(c,d))

print(not_b-not_a_1)

### FIXED CODE ###

import fractions

def lcm(x,y):
    return x*y // fractions.gcd(x,y)


a,b,c,d = map(int,input().split(' '))
not_a_1 =0
not_b = 0
not_b =  b-(b//c)-(b//d)+(b//lcm(c,d))
not_a_1 = a-1-((a-1)//c)-((a-1)//d)+((a-1)//lcm(c,d))

print(not_b-not_a_1)
num = int(input())
li = list(input())
i = int(num/2)
while(i<int(num/2)+1):
  fi = set(li[:i])
  se = set(li[i:])
  ans = len(list(fi & se))
  if i < ans:
    i = ans
  else:
    i = i+1    
 
print(i)

### FIXED CODE ###

li = list(map(int,input().split()))
ans = [li[0]+li[1],li[0]-li[1],li[0]*li[1]]
ans.sort()
print(ans[2])
n,m = map(int, input().split())
py = [[list(map(int, input().split()))] + [i] for i in range(m)]
py.sort(key=lambda x: [x[0], x[1]])
ans = []
P = [0] * (n + 1)
for p, y, i in py:
    P[p] += 1
    tmp = str(p).zfill(6) + str(P[p]).zfill(6)
    ans.append([i,tmp])
ans.sort()
for i,a in ans:
    print(a)

### FIXED CODE ###

n,m = map(int, input().split())
py = [list(map(int, input().split())) + [i] for i in range(m)]
py.sort(key=lambda x: [x[0], x[1]])
ans = []
P = [0] * (n + 1)
for p, y, i in py:
    P[p] += 1
    tmp = str(p).zfill(6) + str(P[p]).zfill(6)
    ans.append([i,tmp])
ans.sort()
for i,a in ans:
    print(a)
d=[0,2,5,5,4,5,6,3,7,6]
N,M=map(int,input().split())
A=list(map(int,input().split()))
l=[]
for a in A:
    l.append([a,d[a]])
l.sort(key=lambda x:x[0],reverse=True)
l.sort(key=lambda x:x[1])
min_val,min_match=l[0]

ans=[]
if N%min_match==0:
    ans.append(str(min_val)*(N//min_match))
from itertools import combinations
for i in range(1,M):
    for p in combinations(l[1:],i):
        v=[]
        m_sum=0
        for val,mat in p:
            v.append(str(val))
            m_sum+=mat
        if (N-m_sum)%min_match==0:
            ans.append(int(''.join(sorted(v+
                [str(min_val)]*((N-m_sum)//min_match),reverse=True))))
print(max(ans))



### FIXED CODE ###

d=[0,2,5,5,4,5,6,3,7,6]
N,M=map(int,input().split())
A=list(map(int,input().split()))

dp = [-1 for i in range(N+1)]
dp[0] = 0


for i in range(1,N+1):
    tmp = -1
    for a in A:
        if i-d[a]>=0 and dp[i-d[a]] != -1:
            tmp = max(tmp,dp[i-d[a]]+1)
    dp[i] = tmp


A.sort(reverse=True)
ans = ''
while N>0:
    for a in A:
        if N-d[a]>=0 and dp[N-d[a]] == dp[N]-1:
            ans += str(a)
            N -= d[a]
            break
print(ans)
def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0
    
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))


### FIXED CODE ###

import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)
import sys
from collections import deque

input = sys.stdin.readline

S = deque(input()[:-1])
reverse_flg = 0
Q = int(input())
qs = [input().split() for _ in range(Q)]
for q in qs:
    if q[0] == '1':
        reverse_flg = reverse_flg ^ 1
    else:
        flg = (int(q[1]) + reverse_flg) % 2
        if flg == 1:
            S.appendleft(q[2])
        else:
            S.append(q[2])

if reverse_flg:
    S = S[::-1]
print(''.join(S))


### FIXED CODE ###

import sys
from collections import deque

input = sys.stdin.readline

S = deque(input()[:-1])
reverse_flg = 0
Q = int(input())
qs = [input().split() for _ in range(Q)]
for q in qs:
    if q[0] == '1':
        reverse_flg = reverse_flg ^ 1
    else:
        flg = (int(q[1]) + reverse_flg) % 2
        if flg == 1:
            S.appendleft(q[2])
        else:
            S.append(q[2])

if reverse_flg:
    S.reverse()
print(''.join(S))
n=input();a=input();b=input();c=input();d=input();e=input()
turn=1
turn+=n//a+1
if n%a==0 and n!=a:
  A=n/a
elif n==a:
  A=n
else:
  A=n%a
turn+=A//b+1
if A%b==0 and n!=b:
  B=A/b
elif A==b:
  B=A
else:
  B=A%b
turn+=B//c+1
if B%c==0 and n!=c:
  C=B/c
elif B==c:
  C=B
else:
  C=B%c
turn+=C//d+1
if C%d==0 and n!=d:
  D=C/d
elif C==d:
  D=C
else:
  D=C%d
turn+=D//e+1
print(turn)

### FIXED CODE ###

N = int(input())
cnt = int()
A=[]
for i in range(5):
    A.append(int(input()))
A.sort()
print(-(-N//min(A))+4)
n = int(input())
a = list(map(int, input().split()))
l = []
for i in a:
    count = 0
    for j in range(1, 10):
        if i%(2**j) == 0:
            count += 1
        else:
            l.append(count)
print(min(l))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
l = []
for i in a:
    count = 0
    for j in range(1, 31):
        if i%(2**j) == 0:
            count += 1
        else:
            l.append(count)
            break
print(min(l))
# コンテスト時にトライしていたアルゴリズム
# その後の検証でアルゴリズムは正しそうなのでコードエラーを探す

n, x = map(int, input().split())
city_list = list(map(int, input().split()))
 
import numpy as np
 
def getNearestValue(list, num):
    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

nearest_city = getNearestValue(city_list, x)
# Dとなり最大値はXと最も近い都市との距離に等しい
max_D = abs(nearest_city-x)

# TLE対策 都市との距離は事前に計算
dist_list = []
for city in city:
    dist_list.append(abs(city - x))


for xx in reversed(range(1, max_D+1)):
    flag = True
    for dist in dist_list:
        if (dist % xx) != 0:
            flag = False
            break
    if flag:
        break
print(xx)

### FIXED CODE ###

import fractions

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

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

dist_list = []
for city in city_list:
    dist_list.append(abs(city - x))

max_common_value = dist_list.pop(0)

for dist in dist_list:
    # 今までのDと次の都市の距離との最大公約数を見つける
    max_common_value = fractions.gcd(max_common_value, dist)

print(max_common_value)
def main():
        n = int(input())
        a = list(map(int,input().split()))
     
        ans_lst = [0 for i in range(max(a)+4)]
     
     
        for i in a:
            ans_lst[i] += 1
            ans_lst[i+1] += 1
            ans_lst[i-1] += 1
     
     
        print(max(ans_lst))
     
     
     
    if __name__ == "__main__":
            main()

### FIXED CODE ###


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

    #lst = [0 for i in range(n*3)]
    ans_lst = [0 for i in range(max(a)+4)]
    """
    for i in range(n):
        lst[3*i] = a[i]
        lst[3*i+1] = a[i]+1
        lst[3*i+2] = a[i]+2
    """

    for i in a:
        ans_lst[i] += 1
        ans_lst[i+1] += 1
        ans_lst[i-1] += 1

    """
    ans = -1
    for i in set(lst):
        ans = max(lst.count(i),ans)
    """

    print(max(ans_lst))


if __name__ == "__main__":
        main()
n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
  yr_m.append(list(map(float,str,input().split())))
 
  
for j in range(n):
  if yr_m[j][1]=="BTC":
    yr_m[j][0]=yr_m[j][0]*380000.0
  sum_m=sum_m+yr_m[j][0]
 
print(sum_m)

### FIXED CODE ###

n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
    yr_m.append(list(map(str,input().split())))

for k in range(n):
    yr_m[k][0]=float(yr_m[k][0])

for j in range(n):
    if yr_m[j][1]=="BTC":
        yr_m[j][0]=yr_m[j][0]*380000.0
    sum_m=sum_m+yr_m[j][0]

print(sum_m)
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
l=[]
for i in range(n):
  x,y,h=nii()
  l.append([x,y,h])
  if h!=0:
    ini_x=x
    ini_y=y
    ini_h=h

ans_x=[]
ans_y=[]
ans_h=[]

for tx in range(101):
  for ty in range(101):
    n_h=abs(tx-ini_x)+abs(ty-ini_y)+ini_h
    for x,y,h in l:
      t_h=abs(tx-x)+abs(ty-y)+h
      if n_h!=t_h:
        break
    else:
      ans_x.append(tx)
      ans_y.append(ty)
      if [tx,ty,0] in l:
        ans_h.append(0)
      else:
        ans_h.append(t_h)

inx=ans_h.index(max(ans_h))
print(ans_x[inx],ans_y[inx],ans_h[inx])

### FIXED CODE ###

from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
l=[]
for i in range(n):
  x,y,h=nii()
  l.append([x,y,h])
  if h!=0:
    ini_x=x
    ini_y=y
    ini_h=h

for tx in range(101):
  for ty in range(101):
    n_h=abs(tx-ini_x)+abs(ty-ini_y)+ini_h
    for x,y,h in l:
      t_h=max(n_h-(abs(tx-x)+abs(ty-y)),0)
      if h!=t_h:
        break
    else:
      print(tx,ty,n_h)
      exit()
n=int(input())
red=[list(map(int,input().split())) for _ in range(n)]
blue=[list(map(int,input().split())) for _ in range(n)]
red.sort()
blue.sort()
 
p=0
for bb in blue:
  lis=[-1,-1]
  for rr in red:
    if rr[0]<bb[0] and rr[1]<bb[1] and lis[1]<rr[1]:
      lis=rr
    if lis!=[-1,-1]:
      red.remove(lis)
      p+=1
print(p)

### FIXED CODE ###

n=int(input())
red=[list(map(int,input().split())) for _ in range(n)]
blue=[list(map(int,input().split())) for _ in range(n)]
red.sort()
blue.sort()
 
p=0
for bb in blue:
  lis=[-1,-1]
  for rr in red:
    if rr[0]<bb[0] and rr[1]<bb[1] and lis[1]<rr[1]:
      lis=rr
  if lis!=[-1,-1]:
    red.remove(lis)
    p+=1
print(p)
_, num_query = list(map(int,input().split()))
string = input()
dfor _ in range(num_query):
  left, right = list(map(int,input().split()))
  sub_string = string[left-1:right]
  print(sub_string.count("AC"))

### FIXED CODE ###

base = input()
if base == "A":
	print("T")
if base == "T":
	print("A")
if base == "C":
	print("G")
if base == "G":
	print("C")
N ,Blue,Red = map(int,input().split())

ans = N //(A+B) *A
rem = N % (A+B)
ans += min(rem,A)
print(ans)

### FIXED CODE ###

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

ans = N //(A+B) *A
rem = N % (A+B)
ans += min(rem,A)
print(ans)
a=list(map(int,input().split()))
for i in range(2):
  
  b+=max(a)
  max(a)=max(a)-1
print(b)

### FIXED CODE ###

a,b=map(int,input().split())
c=0
for i in range(2):
  if a>=b:
    c+=a
    a-=1
  else:
    c+=b
    b-=1
print(c)
import numpy as np
import sys

def main(args):
    a = int(args[0])
    b = int(args[1])
    if 6 <= a and a <= 12:
        v = b//2
    elif a <= 5:
        v = 0
    else:
        v = b
    print(v)

if __name__ == "__main__":
    main(sys.argv[0:2])

### FIXED CODE ###

import numpy as np
from sys import stdin
#sys.setrecursionlimit(10**6) 

def main():
    a, b = [int(x) for x in stdin.readline().rstrip().split()]
    if 6 <= a and a <= 12:
        v = b//2
    elif a <= 5:
        v = 0
    else:
        v = b
    print(v)

if __name__ == "__main__":
    main()
n= int(input())
print(int((n*(n+1))/2))
print(1+n)*n/2

### FIXED CODE ###

n= int(input())
print(int((n*(n+1))/2))
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]] += 1

for i in range(N):
    if P[i] <= Q:
        print("No")
    if P[i] > Q:
        print("Yes")

### FIXED CODE ###

V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]-1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")