Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    N,S=pin()
    A=list(pin())

    #print(A)

    #dp[i]"s""n" i番めまで見る。n個使った。和がsになった2重の辞書…
    dp=[dict()for i  in range(N+1)]
    #sを辞書として管理するとうまく配るDPが実装できるよね
    dp[0].setdefault(0,dict())
    dp[0][0].setdefault(0,1)
    

    for i in range(N):#
        kouho=A[i]
        for s in dp[i]:
            ref=dp[i][s]
            for k,v in ref.items():
                ##print(k,v)
                #saiyousinai
                dp[i+1].setdefault(s,dict())
                dp[i+1][s].setdefault(k,0)
                dp[i+1][s][k]+=v
                #saiyou        
                x=s+kouho
                ##print(x)
                if x<=S:
                    dp[i+1].setdefault(x,dict())
                    dp[i+1][x].setdefault(k+1,0)
                    dp[i+1][x][k+1]+=v
                
    temp=(dp[-1][S])
    ans=0
    for p,q in temp.items():
        if N-p>=0:
            ans+=q*(2**(N-p))
    print(ans)
#%%submit!
resolve()


### FIXED CODE ###

#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    N,S=pin()
    A=tupin()#調子にのるな
    mod=998244353
    
    #形式的冪級数を考える
    #普通の部分和ッ->集合内の各アイテムについて、選ぶか選ばないか。O(2^n)の探索
    #これを形式的冪級数でいえば、（1+x^a）を掛ける計算になる　指数時間ではない
    #つまり、集合A,Sに対して、[x^s]PI(1+x^a_i) (f_i)

    #次に、Aの部分集合について考える
    #サンプル1の場合、N==3なので8個の部分集合がある
    #つまり、F3＝1+(f_1+f_2+f_3)+(f1_f2+f2_f3+f3_f1)+f1_f2_f3を考える
    #果たして、一般的なNにたいして多項式時間でにFnをもとめれば指数時間は完全回避できる
    #F3=(1+f1+f2+f1f2)+f3{(1+f1+f2+f1f2)}
    #  =(1+f3)(1+f1+f2+f1f2)
    #  =(f3で追加された新しいところ)(N=2のときのすべての部分集合)

    #これは、f3をSの部分集合にふくめるか、含めないかの探索と同等
    #一般的にFn=F_n-1*(1+fn)=PI(1+fn)とわかる

    #求めるものは[x^S]PI(1+fn)=[x^S]PI(2+x^a)

    from collections import defaultdict #本当は良くないがわかりやすさのためココに置く
    from copy import deepcopy
    
    ans=defaultdict(int)#i
    ans[0]=1 #init ,1=x^0より
    #print(ans)
    for a in A:
        #ans そのものと、ansの係数にx^aをかけたものを足し算    
        temp=defaultdict(int)
        for x in ans:
            if x+a<=S:
                temp[x+a]=ans[x]
            
            ans[x]*=2
            ans[x]%=mod
        for t in temp:
            if t<=S:
                ans[t]+=temp[t]
                ans[t]%=mod
    print(ans[S])    
    
#%%submit!
resolve()
N = int(input())

c = N.count(2)

print(c)

### FIXED CODE ###

N = input()

c = N.count('2')

print(c)
S = input()

A = S.count('a')
B = S.count('b')
C = S.count('c')

if (A == 1) and (B == 1) and (c == 1):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()

A = S.count('a')
B = S.count('b')
C = S.count('c')

if (A == 1) and (B == 1) and (C == 1):
    print('Yes')
else:
    print('No')
a,b = ((x) for x in input().split(" "))
int(c) = int(a) - int(b)
if c > '0':
    print ( c )
else:
    print('0')

### FIXED CODE ###

X, t = map(int, input().split())
x = X - t
 
if x > 0:
    print(x)
else:
    print(0)
K,S=map(int,input().split())

for i in range(K):
  for j in range(K-i):
    for k in range(K-i-j):
      if i+j+k==S:
        ans+=1
print(ans)

### FIXED CODE ###

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

ans=0

for i in range(K+1):
  if 0<=S-i<=K:
    ans+=S-i+1
  elif K<S-i<=2*K:
    ans+=2*K-(S-i)+1
        
print(ans)
x = [int(input()) for i range(5)]
k = int(input())

for i in range(4):
  for _ in range(1,5):
    if x[i] - x[_] < k:
      print("Yey!")
    else:
      print(":(")

### FIXED CODE ###

x = [int(input()) for i in range(5)]
k = int(input())

for i in range(4):
  for _ in range(1,5):
    if abs(x[i] - x[_]) > k:
      print(":(")
      exit()
print("Yay!")
A,B,C=int(input().split())
if A<=C and B>C:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A,B,C=map(int,input().split())
if A<=C and C<=B:
  print('Yes')
else:
  print('No')
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())z
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



#n=int(input())
n,m=input_list()
#a=input_list()

print(math.floor(n*m))

### FIXED CODE ###

from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())z
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



#n=int(input())
#n,m=input_list()
#a=input_list()
a=input().split()
n=int(a[0])
m=a[1]
ans=0
ans+=n*int(m[0])
ans+=n*int(m[2])//10
ans+=n*int(m[3])//100
mod=0
tmp=int(str(n*int(m[2]))[-1])
if tmp<10:
    tmp*=10
mod+=tmp
#print(mod)
tmp=int(str(n*int(m[3]))[-2:])
mod+=tmp
#print(ans)
#print(mod)
print(ans+mod//100)
from collections import Counter
s = input()
N = len(s)
sc = Counter(s)
del sc['x']

def trim_x():
    s_trim = [c for c in s if c != 'x']
    for i in range(len(s_trim)):
        j = len(s_trim) - 1 - i
        if i >= j:
            break
        if s_trim[i] != s_trim[j]:
            return None
    return s_trim

def solve():
    s_trim = trim_x()  # anagram
    if s_trim is None:
        return -1
    pl = len(s_trim) // 2
    pr = pl
    if len(s_trim) % 2 == 0:
        pr += 1
    xl = 0
    tl = 0
    while xl < N:
        if s[xl] != 'x':
            assert s[xl] == s_trim[tl]
            if tl == pl:
                break
            tl += 1
        xl += 1
    xr = xl + (0 if len(s_trim) % 2 == 1 else 1)
    while s[xr] != s_trim[pr]:
        assert s[xr] == 'x'
        xr += 1
    cost = 0
    while True:
        assert s[xl] == s_trim[pl]
        assert s[xr] == s_trim[pr]
        assert s[xl] == s[xr]
        assert s_trim[pl] == s_trim[pr]
        pl -= 1; pr += 1
        while True:
            xl -= 1; xr += 1
            if not (xl >= 0 and xr < N and s[xl] == 'x' and s[xr] == 'x'):
                break
        while xl >= 0 and s[xl] == 'x':
            cost += 1
            xl -= 1
        while xr < N and s[xr] == 'x':
            cost += 1
            xr += 1
        if pl < 0 and pr >= len(s_trim) and xl < 0 and xr >= N:
            return cost
    raise RuntimeError('never reach here')

print(solve())


### FIXED CODE ###

s = input()
N = len(s)
s_trim = ''.join([c for c in s if c != 'x'])
N_trim = len(s_trim)

def check_anagram():
    for i in range(N_trim):
        j = N_trim - 1 - i
        if s_trim[i] != s_trim[j]:
            return False
    return True

def solve():
    if not check_anagram():
        return -1
    if N_trim == 0:
        return 0
    # Center of anagram
    pr = N_trim // 2
    pl = pr
    if N_trim % 2 == 0:
        pl -= 1

    xl = 0
    tl = 0
    while xl < N:
        if s[xl] != 'x':
            # assert s[xl] == s_trim[tl]
            if tl == pl:
                break
            tl += 1
        xl += 1

    if N_trim % 2 == 1:
        xr = xl
    else:
        xr = xl + 1
        while s[xr] == 'x':
            xr += 1

    cost = 0
    while True:
        # assert s[xl] == s_trim[pl]
        # assert s[xr] == s_trim[pr]
        # assert s[xl] == s[xr]
        # assert s_trim[pl] == s_trim[pr]
        pl -= 1; pr += 1
        while True:
            xl -= 1; xr += 1
            if not (xl >= 0 and xr < N and s[xl] == 'x' and s[xr] == 'x'):
                break
        while xl >= 0 and s[xl] == 'x':
            cost += 1
            xl -= 1
        while xr < N and s[xr] == 'x':
            cost += 1
            xr += 1
        if pl < 0 and pr >= N_trim and xl < 0 and xr >= N:
            return cost

print(solve())
import sympy
N = int(input())

n = len(sympy.divisors(N))

total =  0
for i in range(1,N+1):
    a = i * len(sympy.divisors(i))
    total += a
print(total)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1): #各iについて、i*(1～n//iまでの総和)を足し合わせればよい
 k=n//i
 ans+=i*(k*(k+1)//2)
print(ans)
from collections import Counter
N=int(input())
A=list(map(int,input().split()))

A_=Counter(A)
D=[0]*N
S=0
for k,v in A_.items():
    if v<2:
        continue
    a=v*(v-1)//2
    D[k]=a
    S+=a

for a in A:
    x=A_[a]
    y=x*(x-1)//2
    S-=y
    z=(x-1)*(x-2)//2
    print(S+z)
    S+=y



### FIXED CODE ###

from collections import Counter
N=int(input())
A=list(map(int,input().split()))
A__=list(set(A))
A_=Counter(A)
S=0
for a in A__:
    k=a
    v=A_[a]
    if v<2:
        continue
    a=v*(v-1)//2
    S+=a

for a in A:
    x=A_[a]
    y=x*(x-1)//2
    S-=y
    z=(x-1)*(x-2)//2
    print(S+z)
    S+=y
A = int(input())
B = int(input())
C = int(input())



if A == 5 and B == 5 and C == 7:
    print("YES")

elif A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")


    
else:
    print("NO")


### FIXED CODE ###

a=input().split()
if a.count('5')==2 and a.count('7')==1:
    print('YES')
else:
    print('NO')
import math

firstInputText = input()
inputList = firstInputText.split()
a = int(inputList[0])
b = int(inputList[1])
c = int(inputList[2])
x = math.sqrt(a) + math.sqrt(b)
y = math.sqrt(c)
# print(x)
# print(y)

# if math.isclose(x,y):
#     print("Yes")
# else:
#     print("No")
if x == y:
    print("No")
elif x < y:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

list = [1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
firstInputText = input()
print(list[int(firstInputText) - 1])
n = int(input())
X = input()
x = int(X,2)
bitx = bin(x).count('1')
 
ans = [0]*(bitx+2)
for i in range(1,bitx+2):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
bitp = bitx + 1
bitm = bitx - 1
xmp = 0
xmm = 0

for i in range(n):
    if X[i] == '1':
        xmp += pow(2, n-(i+1), bitp)
        xmm += pow(2, n-(i+1), bitm)
if bitx != 1:
    for i in range(n):
        if X[i] == '1':
            xm = (xmm - pow(2,n-i-1,bitm)) % bitm
            l.append(str(1+ans[xm]))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))

else:
    for i in range(n):
        if X[i] == '1':
            l.append(str(0))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))

print('\n'.join(l))



### FIXED CODE ###

n = int(input())
X = input()
x = int(X,2)
bitx = bin(x).count('1')
 
ans = [0]*(bitx+2)
for i in range(1,bitx+2):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
bitp = bitx + 1
bitm = bitx - 1
xmp = 0
xmm = 0


if bitx != 1:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
            xmm += pow(2, n-(i+1), bitm)
    for i in range(n):
        if X[i] == '1':
            xm = (xmm - pow(2,n-i-1,bitm)) % bitm
            l.append(str(1+ans[xm]))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
else:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
    for i in range(n):
        if X[i] == '1':
            l.append(str(0))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
print('\n'.join(l))
# 入力の取得(空白を除く)
s = list(input().split())

# 処理
isPoor = False
if s[0] == s[1] and s[1] != s[2]:
  isPoor = True
if s[1] == s[2] and s[2] != s[0]:
    isPoor = True
if s[2] == s[0] and s[0] != s[1]:
    isPoor = True

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


### FIXED CODE ###

import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve():
    try:
        r = int(input())

        print(pow(r, 2))

    except IndexError as err:
        print("インデックスエラー:", err.args[0])


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """2"""
        output = """4"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """100"""
        output = """10000"""
        self.assertIO(test_input, output)

    # 自作テストパターン
    def test_original(self):
        pass


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main(verbosity=2)
x = []
u = []
Y = 0
for i in range(N):
    str = input().split(' ')
    x[i] = int(str[0])
    u[i] = int(str[1])
    if u[i] == 'JPY':
        Y += x[i]
    else:
        Y += x[i] * 380000.0
print(Y)

### FIXED CODE ###

N = int(input())
x = 0
u = 0
Y = 0
for i in range(N):
    str = input().split(' ')

    x = float(str[0])
    u = str[1]
    if u == 'JPY':
        Y += x
    else:
        Y += x * 380000.0
print(Y)
a,b=map(int, raw_input())
ans=max([a+a-1,b+b-1,a+b])
print ans



### FIXED CODE ###

a,b=map(int, raw_input().split())
ans=max([a+a-1,b+b-1,a+b])
print ans
n = int(input())
a = list(map(int, input().split()))
result = 1
checker =False
for j in a:
  if j > 1000000000000000000:
    result = -1
    checker =True
if 0 in a:
  result = 0
  checker=True
while checker==False:
  import numpy as np
  a = np.array(a)
  result = np.prod(a)
  checker = True
    

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000:
    break

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
s = Counter(A)
t=[0]*(10**5+1)
for i in range(10**5+1):
    t[i] = s[i]*i
    
for i in range(Q):
    B, C = map(int, input().split())
    num = t[B]//(B)
    t[B] = 0
    t[C] += num*(C)
    print(sum(t))


### FIXED CODE ###


def main(T):
    if T.lower() == T:
        return "a"
    else:
        return "A"


T = input()
print(main(T))
s = input()

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif :
    print("Sunny")


### FIXED CODE ###

s = input()

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else :
    print("Sunny")
n, k = map(int, input().split())
ppp = list(map(int, input().split()))
qqq = list(map(int, input().split()))
ini_p = ppp.copy()
ini_q = qqq.copy()
i = 0
for i in range(k - 2):
    rrr = [q for p, q in sorted(zip(ppp, qqq))]
    if rrr == ini_p:
        break
    ppp = qqq
    qqq = rrr
else:
    print(*qqq)
    exit()

k = k % (i + 2)
ppp = ini_p
qqq = ini_q
for i in range(k - 2):
    rrr = [q for p, q in sorted(zip(ppp, qqq))]
    ppp = qqq
    qqq = rrr
print(*qqq)


### FIXED CODE ###

from operator import itemgetter


def get_identity():
    return list(range(1, n + 1))


def composition(ppp, qqq):
    return [ppp[q - 1] for q in qqq]


def reverse_composition(ppp, qqq):
    return [ppp[i] for i, q in sorted(enumerate(qqq), key=itemgetter(1))]


def solve(k, ppp, qqq):
    qp = reverse_composition(qqq, ppp)
    qpq = reverse_composition(qp, qqq)
    qpqp = composition(qpq, ppp)
   
    l, m = divmod(k - 1, 6)
    res = get_identity()
    tmp = qpqp
    while l:
        if l % 2 == 1:
            res = composition(res, tmp)
        tmp = composition(tmp, tmp)
        l >>= 1

    m = (k - 1) % 6
    if m == 0:
        base = ppp
    elif m == 1:
        base = qqq
    elif m == 2:
        base = reverse_composition(qqq, ppp)
    elif m == 3:
        res = composition(res, qqq)
        base = reverse_composition(get_identity(), ppp)
    elif m == 4:
        res = composition(res, qqq)
        res = reverse_composition(res, ppp)
        base = reverse_composition(get_identity(), qqq)
    elif m == 5:
        res = composition(res, qqq)
        res = reverse_composition(res, ppp)
        base = reverse_composition(get_identity(), qqq)
        base = composition(base, ppp)
    else:
        raise NotImplementedError

    ans = composition(res, base)
    ans = reverse_composition(ans, res)
    return ans


n, k = map(int, input().split())
ppp = list(map(int, input().split()))
qqq = list(map(int, input().split()))
print(*solve(k, ppp, qqq))
while True:
    n,m = list(map(int,input().split()))
    if n == 0 and m == 0:
        break

    amari = n % m
    yasai = list(map(int,input().split())) 
    yasai.sort()

    s = 0
    if amari > 0:
        s = sum(yasai[0:amari])

    i = 0
    for y in yasai[amari:]:
        if i % m > 0:
            s += y
        i+=1

    print(s)

### FIXED CODE ###

while True:
    try:
        n,m = list(map(int,input().split()))
        if n == 0 and m == 0:
            break
        amari = n % m
        yasai = list(map(int,input().split())) 
        yasai.sort()

        s = 0
        for i in range(n):
            if (i+1) % m > 0:
                s += yasai[-i-1]
        print(s)
    except:
        pass
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)

### FIXED CODE ###

line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])

if height !=1 and wei !=1: 
  if height %2 ==0:
    if wei %2 ==0:
      print(int(wei/2)*height)
    else:
      print(int(wei/2)*height+int(height/2))
  else:
    if wei %2 ==0:
      print(int(height/2)* wei + int(wei/2))
    else:
      print(wei* int(height/2) + int(wei/2)+1)
else:
  print(1)
N = int(input())

xyh_list = list()

for i in range(N):
    x,y,h = map(int, input().split())
    xyh_list.append((x,y,h))
    
for i in range(N):
    h = xyh_list[i][2]
    if h != 0:
        no_zero_h = i
        break
else:


break_flag = 0

for i in range(0,101):
    for j in range(0,101):
        
        x = xyh_list[no_zero_h][0]
        y = xyh_list[no_zero_h][1]
        h = xyh_list[no_zero_h][2]
        H = h + abs(x-i) + abs(y-j)
        
        if 1 <= H:
            for k in range(0,N):
                x = xyh_list[k][0]
                y = xyh_list[k][1]
                h = xyh_list[k][2]
                
                if h + abs(x-i) + abs(y-j) != H:
                    break
            else:
                print(i,j,H)
                break_flag = 1
                
        if break_flag == 1:
            break
            
    if break_flag == 1:
        break

### FIXED CODE ###

N = int(input())

xyh_list = list()

for i in range(N):
    x,y,h = map(int, input().split())
    xyh_list.append((x,y,h))
    
for i in range(N):
    h = xyh_list[i][2]
    if h != 0:
        no_zero_h = i
        break


break_flag = 0

for i in range(0,101):
    for j in range(0,101):
        
        x = xyh_list[no_zero_h][0]
        y = xyh_list[no_zero_h][1]
        h = xyh_list[no_zero_h][2]
        H = h + abs(x-i) + abs(y-j)
        
        if 1 <= H:
            for k in range(0,N):
                x = xyh_list[k][0]
                y = xyh_list[k][1]
                h = xyh_list[k][2]
                
                if (h != 0 and h + abs(x-i) + abs(y-j) != H) or (h == 0 and H - abs(x-i) - abs(y-j) > 0):
                    break
            else:
                print(i,j,H)
                break_flag = 1
                
        if break_flag == 1:
            break
            
    if break_flag == 1:
        break
#import math
#from functools import reduce

def gcd(a,b):
    r = 1
    while r > 0:
        r = a % b
        a = b
        b = r

    return a


n = int(input())
a = [int(i) for i in input().split()]
L = [0] * (n-1)
for i in range(n-1):
    L[i] = gcd(a[i],a[i+1])

if n == 3:
    L.append(gcd(a[0],a[2]))

L.sort(reverse=True)

for l in L:
    c = 0
    for i in a:
        if i % l != 0:
            c += 1
    if c <= 1:
        ans = l
        break

print(ans)


### FIXED CODE ###

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


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

L = [0] * n
L[0] = 0
L[1] = A[0]
for i in range(2,n):
    L[i] = gcd(L[i-1], A[i-1])

R = [0] * n
R[-1] = 0
R[-2] = A[-1]
for i in range(3,n+1):
    R[-i] = gcd(R[-i+1], A[-i+1])

M = [gcd(L[i],R[i]) for i in range(n)]

print(max(M))
from collections import deque
S = input()
N = len(S) 
s1 = deque(S[0:int((N-1)/2)])
s2 = deque(S[int((N+3)/2)-1:N])
t1 = deque(S[0:int((N-1)/2)])
t2 = deque(S[int((N+3)/2)-1:N])

while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"
        break

if ans == "preYes":
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
            break
print(ans)

### FIXED CODE ###

from collections import deque
S = input()
N = len(S) 
s1 = deque(S[0:int((N-1)/2)])
s2 = deque(S[int((N+3)/2)-1:N])
t1 = deque(S[0:int((N-1)/2)])
t2 = deque(S[int((N+3)/2)-1:N])
ans = "None"
if len(S) == 3 and S[0] == S[2]:
    ans = "Yes"
while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"
        break

if ans == "preYes":
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
            break
print(ans)