Harryxun/stf_run huggingface dataset:
#Input
l_A =  [[0 for i in range(3)] for j in range(3)]
l_A[0] = list(map(int, input().split()))
l_A[1] = list(map(int, input().split()))
l_A[2] = list(map(int, input().split()))

def detect_BINGO(l_Atf):
    #print(l_Atf)
    #横
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            #print("横" + str(i))
            return True
    #縦
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            #print("縦" + str(i))
            return True
    #斜
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        #print("斜＼")
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][3-1-i]
    if(f_detect):
        #print("斜／")
        return True
    
    #BINGOなし
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("no")


### FIXED CODE ###

import math
N = int(input())
print(math.ceil(N/2))
from collections import defaultdict

class Tree:
  def __init__(self):
    self.edges = defaultdict(set)
  
  def add(self, x, y, w):
    self.edges[x].add((y, w))
    self.edges[y].add((x, w))
  
  def traverse(self, start):
    return self._traverse(start, 0, set([start]), [])
  
  def _traverse(self, start, dist, already_visited, result):
    out_nodes = self.edges[start]
    for out_node, w in out_nodes:
      if out_node in already_visited:
        continue
      new_dist = ((dist % 2) + (w % 2)) % 2
      result.append((out_node, new_dist))
      self._traverse(out_node, new_dist, already_visited | set([out_node]), result)
    return result
      
n = int(input())
tree = Tree()
for _ in range(n-1):
  xyw = list(map(int, input().split()))
  tree.add(*xyw)

node_dists = list(tree.traverse(1))
node_dists.append((1, 0))
node_dists = sorted(node_dists, key=lambda x: x[0])

for node, dist in node_dists:
  print(1 if dist % 2 == 0 else 0)

### FIXED CODE ###

#!/usr/bin/env python
import bisect
from collections import defaultdict
import math

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

    edges = defaultdict(list)
    for _ in range(N-1):
        u, v, w = map(int, input().split())
        edges[u-1].append((v-1, w))
        edges[v-1].append((u-1, w))

    colors = [None]*N
    colors[0] = 0
    colored = [(0, 0)]
    while colored:
        new_colored = []
        for n, d in colored:
            nodes = edges[n]
            for m, w in nodes:
                if colors[m] is None:
                    dist = d + w
                    if dist % 2 == 0:
                        colors[m] = 0
                    else:
                        colors[m] = 1
                    new_colored.append((m, dist))
        colored = new_colored

    for n in range(N):
        print(colors[n])

if __name__ == '__main__':
    main()
a, b = map(int, input().split())
if a =='H' and b =='H':
  print('H')
elif a =='H' and b =='D':
  print('D')
elif a =='D' and b =='H':
  print('D')
else:
  print('H')

### FIXED CODE ###

a, b = map(str, input().split())
if a =='H' and b =='H':
  print('H')
elif a =='H' and b =='D':
  print('D')
elif a =='D' and b =='H':
  print('D')
else:
  print('H')
a,b=map(int,input().split())
ans=false
for i in range(1,4):
  if a*b*c %2 ==1: 
    ans=True
    break    
if ans;print("Yes")
else:print("No")

### FIXED CODE ###

a,b=map(int,input().split())
ans=False
for i in range(1,4):
  if a*b*i %2 ==1: 
    ans=True
    break    
if ans:print("Yes")
else:print("No")
a, b = map(int, input().split())
A = str(bin(a))[2:]
B = str(bin(b))[2:]
if A[-1] == '0':
    if (b-a+1)%2 == 0:
        mae = '0'
    else:
        mae = str(bin(int(A[:-1], 2)+int((b-a)/2)))[2:]
    if (b-a+1)%4 == 0 or (b-a+1)%4 == 1:
        print(int(mae+'0', 2))
    else:
        print(int(mae+'1', 2))
else:
    if (b-a+1)%2 == 0:
        mae = str(bin(int(A[:-1], 2)^int(B[:-1], 2)))[2:]
    else:
        mae = A[:-1]
    if (b-a+1)%4 == 0 or (b-a+1)%4 == 3:
        print(int(mae+'0', 2))
    else:
        print(int(mae+'1', 2))


### FIXED CODE ###

a, b = map(int, input().split())
A = str(bin(a))[2:]
B = str(bin(b))[2:]
if A[-1] == '0':
    if (b-a+1)%2 == 0:
        mae = '0'
    else:
        if a <= 1:
            c = '0'
        else:
            c = A[:-1]
        mae = str(bin(int(c, 2)+int((b-a)/2)))[2:]
    if (b-a+1)%4 == 0 or (b-a+1)%4 == 1:
        print(int(mae+'0', 2))
    else:
        print(int(mae+'1', 2))
else:
    if (b-a+1)%2 == 0:
        if a <= 1:
            c = '0'
        else:
            c = A[:-1]
        if b <= 1:
            d = '0'
        else:
            d = B[:-1]

        mae = str(bin(int(c, 2)^int(d, 2)))[2:]
    else:
        mae = A[:-1]
    if (b-a+1)%4 == 0 or (b-a+1)%4 == 3:
        print(int(mae+'0', 2))
    else:
        print(int(mae+'1', 2))
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    l, r = l - 1, r - 1
    G[l].append((r, d))
    G[r].append((l, -d))
used = [False] * N
dist = [0] * N
flag = False


def dfs(v, d0):
    global flag
    if used[v]:
        if dist[v] != d0:
            flag = True
        return
    else:
        used[v] = True
        dist[v] = d0

    for w, d1 in G[v]:
        dfs(w, d0 + d1)


for i in range(N):
    if not used[i]:
        dfs(i, 0)

if flag:
    print("No")
else:
    print("Yes")



### FIXED CODE ###

import sys
sys.setrecursionlimit(200002)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, q = map(int, input().split())
    G[l - 1].append((r - 1, q))
    G[r - 1].append((l - 1, -q))
X = [None] * N


def dfs(u):
    global X, G
    for w, d in G[u]:
        if X[w] is None:
            X[w] = X[u] + d
            if not dfs(w):
                return False
        else:
            if X[w] != X[u] + d:
                return False

    return True


flag = True
for i in range(N):
    if X[i] is None:
        X[i] = 0
        flag &= dfs(i)

if flag:
    print("Yes")
else:
    print("No")
def main():
  #1:初期化
  N, K = map(int,input().split())
  h = list(map(int, input().split()))
  #print(h,H)
  inf = float("inf")
  dp = [inf]*(N)

  #2:初期値
  dp[0] = 0

  #3:dp実行部(配るDP)
  for i in range(N):
      for k in range(1,min(N-i-1,K)+1):
          dp[i+k] = min(dp[i+k], dp[i] + abs(h[i] - h[i+k]))
          #print(dp,i,k)

  #4:出力
  print(dp[N-1])

if __name__ == '__main__':
    main()

### FIXED CODE ###

#1:初期化
N = int(input())
h = list(map(int, input().split()))
inf = float("inf")
dp = [inf]*(N)

#2:初期値
dp[0] = 0

#3:dp実行部
for i in range(1,N):
    dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
    if(i>1): #2つ目の足場には二個前の足場がないので．
        dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

#4:出力
print(dp[N-1])
A,B,C,D = map(int,input().split())
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(a, b):
    gc = gcd(a, b)
    if gc != 0:
        return a * b // gcd (a, b)
    else:
        return a * b
CD = lcm(C,D)
c_div = 0
d_div = 0
cd_div = 0
ans = 0
if A % C == 0:
    first_C = A
else:
    first_C = A + C -(A%C)
last_C = B -(B%C)
c_div = (last_C - first_C)//C + 1

if A % D == 0:
    first_D = A
else:
    first_D = A + D -(A%D)
    last_D = B - (B%D)
d_div = (last_D - first_D)//D + 1

if A % CD == 0:
    first_CD =A
else:
    first_CD = A + CD -(A%CD)
    last_CD = B -(B%CD)
cd_div = (last_CD - first_CD)//CD + 1

ans = c_div + d_div -cd_div
print(B-A+1-ans)


### FIXED CODE ###

A,B,C,D = map(int,input().split())
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a * b // gcd (a, b)
CD = lcm(C,D)
c_div = 0
d_div = 0
cd_div = 0
ans = 0
if A % C == 0:
    first_C = A
else:
    first_C = A + C -(A%C)
last_C = B -(B%C)
c_div = (last_C - first_C)//C + 1

if A % D == 0:
    first_D = A
else:
    first_D = A + D -(A%D)
last_D = B - (B%D)
d_div = (last_D - first_D)//D + 1

if A % CD == 0:
    first_CD =A
else:
    first_CD = A + CD -(A%CD)
last_CD = B -(B%CD)
cd_div = (last_CD - first_CD)//CD + 1

ans = c_div + d_div -cd_div
print(B-A+1-ans)
s=input()
a = 1

for i in range(0..3):
    if s[i] == +:
        a = a + 1
    else:
        a = a - 1


### FIXED CODE ###

s=input()
a = 0

for i in range(0,4):
    if s[i] == '+':
        a = a + 1
    else:
        a = a - 1
print(a)
from collections import deque
N=int(input())
A=list(map(int,input().split()))
reverse_A=list(reversed(A))
numbers=[]
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
boxes=[0 for _ in range(N)]
for n in range(N):
    yakusuu=make_divisors(n+1)
    numbers+=[yakusuu]
reverse_numbers=list(reversed(numbers))
answers=[0 for _ in range(N)]
balls=[0 for _ in range(N)]
for n in range(N-1):
    number=reverse_numbers[n]
    if balls[n]%2==0 and reverse_A[n]==1:
        answers[n]+=1
        for num in number:
            balls[num-1]+=1
    elif balls[n]%2==1 and reverse_A[n]==0:
        answers[n] += 1
        for num in number:
            balls[num - 1] += 1
if sum(answers)%2==0 and reverse_A[-1]==1:
    answers[-1]+=1
elif sum(answers)%2==1 and reverse_A[-1]==0:
    answers[-1]+=1
print(sum(answers))
    reverse_answers = list(reversed(answers))
    kotae = []
    for n in range(N):
        if reverse_answers[n] != 0:
            kotae.append(n + 1)
    print(*kotae)


### FIXED CODE ###

from collections import deque
N=int(input())
A=list(map(int,input().split()))
reverse_A=list(reversed(A))
numbers=[]
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
boxes=[0 for _ in range(N)]
for n in range(N):
    yakusuu=make_divisors(n+1)
    numbers+=[yakusuu]
reverse_numbers=list(reversed(numbers))
answers=[0 for _ in range(N)]
balls=[0 for _ in range(N)]
for n in range(N-1):
    number=reverse_numbers[n]
    if balls[n]%2==0 and reverse_A[n]==1:
        answers[n]+=1
        for num in number:
            balls[-num]+=1
    elif balls[n]%2==1 and reverse_A[n]==0:
        answers[n] += 1
        for num in number:
            balls[-num] += 1
if sum(answers)%2==0 and reverse_A[-1]==1:
    answers[-1]+=1
elif sum(answers)%2==1 and reverse_A[-1]==0:
    answers[-1]+=1
print(sum(answers))
reverse_answers = list(reversed(answers))
kotae = []
for n in range(N):
    if reverse_answers[n] != 0:
        kotae.append(n + 1)
print(*kotae)
N=int(input())
s=list(input())
from collections import Counter
d=Counter(s)
ans=1
for v in d.values():
  ans*=(v+1
ans-=1
ans=ans%(10**9+7)
print(ans)


### FIXED CODE ###

N=int(input())
s=list(input())
from collections import Counter
d=Counter(s)
ans=1
for v in d.values():
  ans*=(v+1)
ans-=1
ans=ans%(10**9+7)
print(ans)
S = input()
res = "Yes"
for n in range(int(len(S/2))):
  if S[2*n+1] not in ["R","U","D"]:
    res = "No"
  if S[2*n] not in ["L","U","D"]:
    res = "No"
print(res)

### FIXED CODE ###

S = input()
res = "Yes"
for x in range(int(len(S)/2)+1):
  if 2*x < len(S):
    if S[2*x] not in ["R","U","D"]:
      res = "No"
  if 2*x + 1 < len(S):
    if S[2*x+1] not in ["L","U","D"]:
      res = "No"
print(res)
import bisect
n,m=map(int,input().split())
A=sorted(list(map(int,input().split())))
c=A.pop()//2
l=[c]
for _ in range(m-1):
  c=l.pop()
  if c>=A[-1]:
    c//=2
    bisect.insort_left(l,c)
  else:
    l+=[c]
    c=A.pop()//2
    bisect.insort_left(l,c)
print(sum(A)+sum(l))

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
A=list(map(int,input().split()))
hq=[]
for i in A:
  heapq.heappush(hq,-i)
for _ in range(m):
  m=-((-heapq.heappop(hq))//2)
  heapq.heappush(hq,m)
print(-sum(hq))
S=input()
T=input()
for i in range(len(S)):
    if S!=T:
        S=S[-1]+S[:-1]
        print(S)
    else:
        print('Yes')
        sys.exit()
        
print('No')

### FIXED CODE ###

import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

S=input()
T=input()
for i in range(len(S)):
    if S!=T:
        S=S[-1]+S[:-1]
    else:
        print('Yes')
        sys.exit()
        
print('No')
N, A, B = map(int, input().split())
p = N//(A + B) + 1

balls = ("b"*A + "r"*B)*p

print(len(balls[0:N].replace("r","")))


### FIXED CODE ###

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

a = N//(A + B)
b = N%(A + B)

if A <= b:
  print(a*A + A)
else:
  print(a*A + b)
n = int(input())
iro = [-1 for i in range(n+1)]
dp = [1 for i in range(n+1)]
mod = 10**9 + 7
for i in range(1,n+1):
    dp[i] = dp[i-1]
    now = int(input())
    if iro[now] == -1:
        iro[now] = i
    elif iro[now] != i-1:
        dp[i] += dp[iro[now]]
        iro[now] = i
    dp[i] %= mod
print(dp[n])

### FIXED CODE ###

n = int(input())
iro = [-1 for i in range(2*(10**5)+1)]
dp = [1 for i in range(n+1)]
mod = 10**9 + 7
for i in range(1,n+1):
    dp[i] = dp[i-1]
    now = int(input())
    if iro[now] != -1 and iro[now] != i-1:
        dp[i] += dp[iro[now]]
    iro[now] = i
    dp[i] %= mod
print(dp[n])
N, K = list(map(int, input().split()))
S = input()

ans = -1    # 十分に小さい値
if (S[0] == '0'):
    stand = 1
else:
    stand = 0

l = 0
r = 0

# 尺取り法
while (r < N):
    # 右端を進めることが可能（進めたときの積がK以下）なら、右端を進める
    if (stand <= K):
        ans = max(ans, r - l + 1)
        if (S[r] == '1' and S[r + 1] == '0'):
            stand += 1
        r += 1
    # 進められない場合、左端と右端が同じなら両者を進める
    # 左端が右端を追い越さないための処理
    elif (l == r):
        l += 1
        r += 1
    # それ以外は左端のみを進める
    else:
        if S[l] == '0' and if S[l + 1] == '1':
            stand -= 1
        l += 1


### FIXED CODE ###

N, K = list(map(int, input().split()))
S = input()

S = S + 'E'   # 終端処理
ans = -1    # 答えの初期値（十分に小さい値）

# 立った人の連続の数
if (S[0] == '0'):
    stand = 1
else:
    stand = 0

L = 0
R = 0

# 尺取り法
while (R < N):
    # 右端を進めることが可能（立った人の連続の数がK以下）なら、右端を進める
    if (stand <= K):
        # 立った人の連続の集合数が増えるなら1足す
        if (S[R] == '1' and S[R + 1] == '0'):
            stand += 1
        ans = max(ans, R - L + 1)
        R += 1
    # 進められない場合、左端と右端が同じなら両者を進める
    # 左端が右端を追い越さないための処理
    elif (L == R):
        L += 1
        R += 1
    # それ以外は左端のみを進める
    else:
        # 立った人の連続の数が減るなら1減らす
        if (S[L] == '0' and S[L + 1] == '1'):
            stand -= 1
        L += 1

print(ans)
import queue
n,m=map(int,input().split())
A=[]
B=[]
c=[0]*(n+1)
for _ in range(m):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
q=queue.Queue()
q.put(1)
count=n-1
while not q.empty() and count>0:
    aa=q.get()
    for i in range(m):
        print(aa)
        print(c)
        if A[i]==aa:
            if c[B[i]]==0:
                c[B[i]]=aa
                count-=1
                q.put(B[i])
                B[i]=-1
        elif B[i]==aa:
            if c[A[i]]==0:
                c[A[i]]=aa
                count-=1
                q.put(A[i])
                A[i]=-1
print('Yes')
for i in range(2,n+1):
    print(c[i])
    

### FIXED CODE ###

n,m=map(int,input().split())
route=[[] for _ in range(n+1)]
for _ in range(m):
    a,b=map(int,input().split())
    route[a].append(b)
    route[b].append(a)
from collections import deque
q=deque()
q.append(1)
sigh=[0]*(n+1)
depth=[0]*(n+1)
depth[1]=0
while q:
    a=q.popleft()
    for i in route[a]:
        if depth[i]==0 or depth[i]>depth[a]+1:
            if i!=1:
                depth[i]=depth[a]+1
                q.append(i)
                sigh[i]=a
print('Yes')
for i in range(2,n+1):
    print(sigh[i])
S=list(input())
i=0
while 0<=i<=len(S)-2:
    if S[i]=="S":
        if S[i+1]=="T":
            S.remove(S[i])
            S.remove(S[i])
        if S[i+1]=="S":
            i+=1
    if S[i]=="T":
        i+=1
while 0<=i<=len(S)-2:
    if S[i]=="S":
        if S[i+1]=="T":
            S.remove(S[i])
            S.remove(S[i])
            i=0
        if S[i+1]=="S":
            i+=1
    if S[i]=="T":
        i+=1
print(len(S))

### FIXED CODE ###

S=input()
t=0
u=0
for i in range(len(S)):
    if S[i]=="S":
        t+=1
    else:
        if t>=1:
            u+=2
            t-=1
print(len(S)-u)
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
A = LI()
L = list(accumulate(A, gcd))
R = list(accumulate(reversed(A), gcd))
ans = 0
for i in range(1, n):
    ans = max(ans, gcd(L[i-1], R[i-1]))
ans = max(ans, L[-2])
ans = max(ans, R[-2])
print(ans)


### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
A = LI()
# L = list(accumulate(A, gcd))
# R = list(accumulate(reversed(A), gcd))
tmpl = 0
tmpr = 0
L = []
R = []
for i in range(n):
    tmpl = gcd(tmpl, A[i])
    tmpr = gcd(tmpr, A[-1-i])
    L.append(tmpl)
    R.append(tmpr)

R = list(reversed(R))
# print(L)
# print(R)

ans = max(L[n-2], R[1])
for i in range(1, n-1):
    ans = max(ans, gcd(L[i-1], R[i+1]))

print(ans)
import numpy as np
n, c = list(map(int, input().split()))
xv = list(list(map(int, input().split())) for i in range(n))
sushi1, max1, sushi2, max2 = [0], [0], [0], [0]
sum1, sum2 = 0, 0
for x, v in xv:
    sum1 += v
    sushi1.append(max(sum1 - x, sushi1[-1]))
    max1.append(max(sum1 - 2*x, max1[-2]))
for x, v in xv[::-1]:
    sum2 += v
    sushi2.append(max(sum2 - (c-x), sushi[-1]))
    max2.append(max(sum2 - 2*(c-x), max2[-1]))
ans1 = max(np.array(sushi1) + np.array(max2[::-1]))
ans2 = max(np.array(sushi2) + np.array(max1[::-1]))
print(max(0, ans1, ans2))

### FIXED CODE ###

import numpy as np
n, c = list(map(int, input().split()))
xv = list(list(map(int, input().split())) for i in range(n))
sushi1, max1, sushi2, max2 = [0], [0], [0], [0]
sum1, sum2 = 0, 0
for x, v in xv:
    sum1 += v
    sushi1.append(max(sum1 - x, sushi1[-1]))
    max1.append(max(sum1 - 2*x, max1[-1]))
for x, v in xv[::-1]:
    sum2 += v
    sushi2.append(max(sum2 - (c-x), sushi2[-1]))
    max2.append(max(sum2 - 2*(c-x), max2[-1]))
ans1 = max(np.array(sushi1) + np.array(max2[::-1]))
ans2 = max(np.array(sushi2) + np.array(max1[::-1]))
print(max(0, ans1, ans2))
def resolve():
    N = int(input())
    conds = [list(map(int, input().split(" "))) for i in range(N)]
    
    # [[cx, cy, H]]
    candidates = []

    cond = conds[0]
    for cx in range(101):
        for cy in range(101):
            H = abs(cond[0]-cx)+abs(cond[1]-cy)+cond[2]
            if 1 <= H:
                candidates.append([cx, cy, H])
    
    ans = []
    for cand in candidates:
        ansflg = True
        for n in range(1, N):
            cond = conds[n]
            H = abs(cond[0]-cand[0])+abs(cond[1]-cand[1])+cond[2]
            if H != cand[2]:
                ansflg = False
                break
        if ansflg:
            ans = cand
            break
    
    print("{} {} {}".format(ans[0], ans[1], ans[2]))

    


if '__main__' == __name__:
    resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    conds = [list(map(int, input().split(" "))) for i in range(N)]
    
    first = sorted(conds, reverse=True, key=lambda x:x[2])[0]
    for cx in range(101):
        for cy in range(101):
            H = abs(first[0]-cx)+abs(first[1]-cy)+first[2]
            for n in range(N):
                cond = conds[n]
                if cond[2] == 0:
                    if abs(cond[0]-cx)+abs(cond[1]-cy) < H: 
                        break
                elif abs(cond[0]-cx)+abs(cond[1]-cy)+cond[2] != H:
                    break
            else:
                print("{} {} {}".format(cx, cy, H))
                exit()


if '__main__' == __name__:
    resolve()
print(list(map(int,input().split()).index(0) + 1)


### FIXED CODE ###

print(list(map(int,input().split())).index(0) + 1)
n, x = map(int, input( ).split())
a = list(map(int, input().split()))
counter = 0
for i in a.sort():
  x -= i
  if x <0:
    print(counter)
  else:
    counter += 1

### FIXED CODE ###

n, x = map(int, input( ).split())
a = list(map(int, input().split()))
counter = 0
for i in sorted(a):
  x -= i
  counter += 1
  if x<0:
    print(counter-1)
    break
  elif x==0:
    print(counter)
    break
  else:
    if counter==n:
      print(counter-1)
a = [0 for i in range(26)]
cnt = 0
while True:
    S = input()
    if S == "-1":
        break
    for i in S:
        if 65 <= ord(i) and ord(i) <= 90\
        or 97 <= ord(i) and ord(i) <= 122:
            if 65 <= ord(i) and ord(i) <= 90:
                cnt = ord(i) - ord("A")
            else:
                cnt = ord(i) - ord("a")
            a[cnt] += 1
            cnt = 0
for i in range(26):
    print(chr(i + 97), ":", a[i])

### FIXED CODE ###

import sys
cnts = {}
for line in sys.stdin:
    for c in list(line.lower()): cnts[c] = cnts.get(c,0) + 1
  
for c in range(ord('a'),ord('z')+1): print(chr(c),':',cnts.get(chr(c),0))
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e-a) =< k:
    print("Yay!")
else:
    print(":(")


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

i = e-a

if i <= k:
    print("Yay!")
else:
    print(":(")
n=int(input())
P,*A=[2]
for L in range(3,9999):
 if len(A)==n:break
 if all(L%M for M in P):
  P+=L,
  if L%5>3:A+=L,
print(*A)

### FIXED CODE ###

n = int(input())
P, A = [2], []
for L in range(3, 55556, 2):
  if len(A) == n:
    break
  if all(L % M for M in P):
    P += L,
    if L % 5 == 1:
      A += L,
print(*A)