Harryxun/stf_run huggingface dataset:
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = []

waribiki = [[0] * A for i in range(B)]
for _ in range(M):
    x,y,c = map(int,input().split())
    waribiki[x-1][y-1]=c

for numA,i in enumerate(a):
    for numB,j in enumerate(b):
        ans.append(i+j-waribiki[numB][numA])

print(min(ans)) 

### FIXED CODE ###

A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

ans = []
waribiki = []

for _ in range(M):
    x,y,c = map(int,input().split())
    waribiki.append(a[x-1]+b[y-1]-c)
a_min=min(a)
b_min=min(b)
ab_min = a_min+b_min
waribiki_min = min(waribiki)
print(min(waribiki_min,ab_min))
import math
from decimal import Decimal, ROUND_HALF_UP
def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // math.gcd(x, a[i])
    return x
def gcd(a):
  temp = math.gcd(a[0], a[1])
  for i in a:
    temp = math.gcd(temp,  i)
  return temp
n,m = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
zero = False
count = 0
#a = list(map(lambda x: x // 2, na))
mini = lcm(a)
maxi = gcd(a)
maxi2 = maxi
nibai = 1
while(True):
  if maxi2 % 2 == 0:
    nibai *= 2
    maxi2 //= 2
  else:
    break
for i in a:
  if i % (2 * nibai) == 0:
    zero = True
    break
#print(nibai, maxi, mini)
if not zero:
  t = Decimal(str((m * 2 // mini) / 2))
  #print(t)
  print(t.quantize(Decimal('0'), rounding=ROUND_HALF_UP))
else:
  print(0)

### FIXED CODE ###

import math
from decimal import Decimal, ROUND_HALF_UP
def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // math.gcd(x, a[i])
    return x
def gcd(a):
  temp = math.gcd(a[0], a[1])
  for i in a:
    temp = math.gcd(temp,  i)
  return temp
n,m = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
zero = False
count = 0
#a = list(map(lambda x: x // 2, na))
mini = lcm(a)
if len(a) != 1:
  maxi = gcd(a)
else:
  maxi = a[0]
maxi2 = maxi
nibai = 1
while(True):
  if maxi2 % 2 == 0:
    nibai *= 2
    maxi2 //= 2
  else:
    break
for i in a:
  if i % (2 * nibai) == 0:
    zero = True
    break
#print(nibai, maxi, mini)
if not zero:
  t = Decimal(str((m * 2 // mini) / 2))
  #print(t)
  print(t.quantize(Decimal('0'), rounding=ROUND_HALF_UP))
else:
  print(0)
A,B,K = map(int,input().split())

count = 0
for i in range(A+B):
    if A%i==0 and B%i==0:
        count +=1
        if count == K:
            print(i)
            break

### FIXED CODE ###

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

wari = []
count = 0
for i in range(1,A+B):
    if A%i==0 and B%i==0:
        wari.append(i)
print(wari[len(wari)-K])
import numpy as np

from functools import reduce

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
ans = 0

def lcm(a, b):
    return (a * b) // np.gcd(a, b)

L = reduce(lcm, a)

# print(L)

for i in range(n):
    ans += (L // a[i])
    ans %= mod

print(ans)

### FIXED CODE ###

from functools import reduce

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
ans = 0

def gcd(a, b):
    # 大きい方を被除数、小さい方を除数とする
    dividend = max(a, b)
    divider = min(a, b)

    if divider == 0:
        return dividend

    # 最大公約数を見つけるまで繰り返す
    while dividend % divider != 0:
        # 除算を行い、その除数を次回の被除数、剰余を次回の除数として処理を繰り返す
        r = dividend % divider
        dividend = divider
        divider = r

    # 一方がもう一方を割り切れた時点で、その除数を最大公約数とみなせる
    return divider


def lcm(a, b):
    return (a * b) // gcd(a, b)

def modinv(x):
    return pow(x, mod-2, mod)

b = list(set(a))
# for i in range(n):

# L = reduce(lcm, a)
L = reduce(lcm, b)

# print(L)

for i in range(n):
    # ans += (L // a[i])
    ans += L * modinv(a[i])

print(ans % mod)
i = input()

T = ['dreamer', 'dream', 'eraser', 'erase']

ans = False

def exec(s):
    for t in T:
        if s.startswith(t):
            n = s.replace(t, '', 1)
            if len(n) == 0:
                print('YES')
                exit()
            else:
                exec(n)

exec(i)
print('NO')

### FIXED CODE ###

i = input()[::-1]
T = []
for t in ['dreamer', 'dream', 'eraser', 'erase']:
    T.append(t[::-1])

match = True
while match:
    match = False
    for t in T:
        if i.startswith(t):
            match = True
            i = i.replace(t, '', 1)
            if len(i) < 1:
                print('YES')
                exit()

print('NO')
two_digits = input()
(a, b) = two_ditigs.split(' ')
if int(a)%2 == 0 or int(b)%2 ==0:
    print('Even')
else:
    print ('Odd')

### FIXED CODE ###

two_digits = input()
(a, b) = two_digits.split(' ')
if int(a) % 2 == 0 or int(b) % 2 == 0:
    print('Even')
else:
    print('Odd')
import numpy as np
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=1
c=0
l=0
r=-1
while True:
    if k-c>=2:
        if a[r]*a[r-1]>=a[l]*a[l+1]:
            s*=a[r]*a[r-1]
            r-=2
            c+=2
        else:
            s*=a[l]*a[l+1]
            l+=2
            c+=2
    else:
        if a[r]<0:
            s=1
            a=np.abs(a)
            a=list(a)
            a.sort()
            print(a)
            while True:
                s*=a[c1]
                c1+=1
                s%=10**9+7
                print(s)
                if c1==k:
                    s=-s
                    print(s%10**9+7)
                    exit()
        else:s*=a[r]
        c+=1
    s%=10**9+7
    if k==c:break
print(s)

### FIXED CODE ###

import numpy as np
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=1
c=0
l=0
r=-1
c1=0
while True:
    if k-c>=2:
        if a[r]*a[r-1]>a[l]*a[l+1]:
            s*=a[r]*a[r-1]
            r-=2
            c+=2
        else:
            s*=a[l]*a[l+1]
            l+=2
            c+=2
    else:
        if a[r]<0:
            s=1
            a=np.absolute(a)
            a=list(a)
            a.sort()
            while True:
                s*=a[c1]
                c1+=1
                s%=10**9+7
                if c1==k:
                    s=-s
                    print(s%10**9+7)
                    exit()
        else:s*=a[r]
        c+=1
    s%=10**9+7
    if k==c:break
print(s)
n = int(input())
a = list(map(int,input().split()))
b = ["A" for i in range(1000001)]

for i in range(n):
    if i % 2 != 0:
        b.append(a[i])
    else:
        b[1000000-i] = a[i]

while b[0] == "A" :
    del b[0]

while "A" in b:
    b.remove("A")

if n % 2 != 0:
    pass
else:
    b.reverse()

for i in range(len(b)):
    if i == len(b) - 1:
        print(b[i])
        break
    print(b[i],end = " ")

### FIXED CODE ###

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

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

print(min(a+b,b+c,c+a))
S = str(input())
count = 0;
for i in range(100000)
  count=count+S.count('BW');
  S = S.replace('BW','WB');
  if 'BW' not in S:break;
print(count)


### FIXED CODE ###

S = input()
ans = 0
tmp = 0
for i in range(len(S)):
  if S[i] == 'W':
    ans+=i-tmp
    tmp+=1
print(ans)
3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

### FIXED CODE ###

N = int(input())

ot = 0
for i in range(N):
    x,u = input().split()
    if u == 'JPY':
        ot += int(x)
    if u == 'BTC':
        ot += float(x)*380000
        
print(ot)
week = {'SUN':7, 'MON':6, 'TUE':5, 'WED':4, 'THE':3, 'FRI':2, 'SAT':1}
S = input()
print(week[S])

### FIXED CODE ###

week = {'SUN':7, 'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'SAT':1}
S = input()
print(week[S])
n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(list(map(int,input().split())))
l.sort()
xi=0
i=0
x=[None for i in range(10**5)]
while i<m:
    x[l[0][0]]=0
    if l[i][0]==xi:
        if x[l[i][1]]==None:
            x[l[i][1]]=l[i][2]+x[l[i][0]]
            i+=1
        else:
            print('No')
            break
    else:
        xi+=1
if i<m:
    pass
else:
    print('Yes')

### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)
import sys

cin = sys.stdin
# cin = open("in.txt", "r")


def line2N():
    return map(int, cin.readline().split())


N, M = line2N()
x = [0] * N
y = [0] * N
z = [0] * N
for i in range(N):
    x[i], y[i], z[i] = line2N()

vis = [False] * N
pool = set(range(N))

if M==0:
    print(0)
    exit(0)

rMax = 0
for k0 in range(N):
    k = k0
    pool = set(range(N))
    x0, y0, z0 = x[k], y[k], z[k]
    pool.remove(k)
    for i in range(M-1):
        k = -1
        maxV = 0
        for p in pool:
            v = abs(x0 + x[p]) + abs(y0+y[p]) + abs(z0+z[p])
            if v>maxV:
                maxV = v
                k = p
        x0, y0, z0 = x0 + x[k], y0+y[k], z0+z[k]
        pool.remove(k)
    maxV = abs(x0) + abs(y0) + abs(z0)
    if rMax<maxV:
        rMax = maxV

print(rMax)


### FIXED CODE ###

import sys
import itertools

cin = sys.stdin
# cin = open("in.txt", "r")


def line2N():
    return map(int, cin.readline().split())


N, M = line2N()
if M==0:
    print(0)
    exit(0)
x = [0] * N
y = [0] * N
z = [0] * N
for i in range(N):
    x[i], y[i], z[i] = line2N()

rMax = 0
for sx, sy, sz in itertools.product((-1,1), repeat=3):
    s = [sx * xi + sy * yi + sz * zi for xi, yi, zi in zip(x, y, z)]
    s.sort()
    rMax = max(rMax, sum(s[-M:]))

print(rMax)
import sys
sys.setrecursionlimit(10**6)
n,m = map(int,input().split())
e = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    e[a].append(b)
    e[b].append(a)
qv = int(input())
Q = [list(map(int,input().split())) for i in range(qv)]
Q = Q[::-1]
l = [[0]*(11) for i in range(n+1)]
for v,d,c in Q:
    if l[v][d] > 0:
        continue
    l[v][d] = c
dic = {}
color = [0]*(n+1)

left = [i for i in range(1,n+1)]
num = 0
while num < qv and left:
    v,d,c = Q[num]
    if v not in dic:
        for i in range(10,-1,-1):
            if l[v][i] > 0:
                M = i
                break
        dic[v] = [set() for i in range(n+1)]
        s = set()
        s.add(v)
        dist = [float("INF")]*(n+1)
        dist[v] = 0
        q = [v]
        for i in range(1,m+1):
            nq = []
            for now in q:
                for nex in e[now]:
                    if dist[nex]<= i:
                        continue
                    nq.append(nex)
                    dist[nex] = i
                    s.add(nex)
            dic[v][i] |= s
            q = nq
    nl = []
    
    for i in left:
        if i in dic[v][d]:
            color[i] = c
        else:
            nl.append(i) 
    num += 1
    
    left = nl
    
for i in color[1:]:
    print(i)

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**6)
n,m = map(int,input().split())
e = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    e[a].append(b)
    e[b].append(a)
qv = int(input())
Q = [list(map(int,input().split())) for i in range(qv)]

color = [0]*(n+1)
used = [-1]*(n+1)

for v,d,c in Q[::-1]:
    if used[v] > d:
        continue
    
    q = deque([[v,d]])
    while q:
        now, dis = q.popleft()
        if dis < 0:
            continue
        if color[now] == 0:
            color[now] = c
        for nex in e[now]:
            if used[nex] < dis-1:
                used[nex] = dis-1
                q.append([nex,dis-1])
    
for i in color[1:]:
    print(i)
if __name__=="__main__":
    l = list(input())
    N = len(l)
    pre = l[0]
    results = []
    for i in range(1,N):
        if not l[i]==pre:
            pre = l[i]
            results.append(max(i+1,N-i-1))
    print(min(results))

### FIXED CODE ###

if __name__=="__main__":
    l = list(input())
    N = len(l)
    results = []
    for i in range(0,N-1):
        if not l[i]==l[i+1]:
            results.append(max(i+1,N-i-1))
    if len(results):
        print(min(results))
    else:
        print(N)
K,S =map(int, input().split())
c=0
for i in range(K+1)
	for j in range(K+1)
		if 0<=S-i-j<=K
			c+=1

print(c)

### FIXED CODE ###

K,S =map(int, input().split())
c=0
for i in range(K+1):
	for j in range(K+1):
		if 0<=S-i-j<=K:
			c+=1

print(c)
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

    # 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())


### 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())
n=int(input())
d=[]
if n>=4:
  for i in range(4):
    d.append(list(map(int,input().split())))
else:
  d=[list(map(int,input().split())) for i in range(n)]
  
for Cx in range(101):
  for Cy in range(101):
    k=0
    for i in range(n-1):
      if d[i][2]+abs(d[i][0]-Cx)+abs(d[i][1]-Cy) != d[i+1][2]+abs(d[i+1][0]-Cx)+abs(d[i+1][1]-Cy):
        k=1
    if k==0:
      print(Cx,Cy,d[i][2]+abs(d[i][0]-Cx)+abs(d[i][1]-Cy))
      
        

### FIXED CODE ###

n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2], reverse=True)

ansh=-1
ans=[[]]
flag=True
for cx in range(0,101):
  if flag==False:
    break
    
  for cy in range(0,101):
    ansh = 0
    for pira in xyh:
      if ansh==0:
        ansh=pira[2]+(abs(cx-pira[0])+abs(cy-pira[1]))
        ans[0]=[cx,cy,ansh]
        
      elif len(ans[0])>0 and max(ansh -(abs(cx-pira[0])+abs(cy-pira[1])), 0) != pira[2]:
        ans[0]=[]
    if len(ans[0])>0:
      flag=False
      break
print(*ans[0])
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A = input()
B = input()
if A>=9 or B>=9:
    print(":(")
else:
    print("Yay!")


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 23:09:00 2018

@author: sakas
"""
A, B = map(int, input().split())
if A>=9 or B>=9:
    print(":(")
else:
    print("Yay!")
import functools

@functools.lru_cache(None)
def Fib(n):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return Fib(n-1)+Fib(n-2)
        
        
        
        
n, m = [int(i) for i in input().split()]
a = [int(input()) for i in range(m)]
MOD = 1000000007

#出来ない判定
for i in range(m-1):
    if (a[i+1] - a[i]) == 1:
        print(0)
        exit()

#壊れてる床前後で組み合わせ

allnum = 1
i = 0
for b in range(m):
    #print(b, i, allnum)
    buf= Fib(a[b]-1 - i + 2)
    allnum *= buf
    i = a[b]+1
    #print(b, i, allnum)

buf = Fib(n - i + 2)
# print(n, i, buf)

allnum *= buf

print(allnum%MOD)

### FIXED CODE ###

import sys
 
n, m = list(map(int, input().split()))
if m > 0:
    aaa = set(map(int, sys.stdin))
else:
    aaa = set()
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7
 
for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print(dp[n])
import sys
from collections import deque
H, W = map(int, input().split())
gridgraph = []
for line in sys.stdin.readlines():
    line = line.rstrip()
    gridgraph.append(list(line))

visited = [[False]*W for _ in range(H)]
ans = [[1e+9]*W for _ in range(H)]
# for i in range(H):
#     for j in range(W):
#         if gridgraph[i][j] == "#":
#             q.append((i, j))
#             visited[i][j] = True
#             ans[i][j] = 0
a = [[j == "#" for j in input()] for _ in range(H)]
que = deque([(i, j) for i in range(H) for j in range(W) if a[i][j]])
# for a, b in q:
#     print(a, b)
# exit()
while len(q):
    cy, cx = q.popleft()
    # print(cy, cx)
    for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
        if not (cy+dy >= 0 and H-1 >= cy+dy and cx+dx >= 0 and W-1 >= cx+dx):
            continue
        if visited[cy+dy][cx+dx]:
            continue
        visited[cy+dy][cx+dx] = True
        ans[cy+dy][cx+dx] = min(ans[cy+dy][cx+dx], ans[cy][cx]+1)
        q.append((cy+dy, cx+dx))
    # print(ans)
    # exit()

min_value = 0
for a in ans:
    min_value = max(min_value, max(a))
print(min_value)


### FIXED CODE ###

import sys
from collections import deque
H, W = map(int, input().split())
gridgraph = []
for line in sys.stdin.readlines():
    line = line.rstrip()
    gridgraph.append(list(line))
q = deque()
visited = [[False]*W for _ in range(H)]
ans = [[1e+9]*W for _ in range(H)]
for i in range(H):
    for j in range(W):
        if gridgraph[i][j] == "#":
            q.append((i, j))
            visited[i][j] = True
            ans[i][j] = 0

while len(q):
    cy, cx = q.popleft()

    for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
        if not (cy+dy >= 0 and H-1 >= cy+dy and cx+dx >= 0 and W-1 >= cx+dx):
            continue
        if visited[cy+dy][cx+dx]:
            continue
        visited[cy+dy][cx+dx] = True
        ans[cy+dy][cx+dx] = min(ans[cy+dy][cx+dx], ans[cy][cx]+1)
        q.append((cy+dy, cx+dx))

min_value = 0
for a in ans:
    min_value = max(min_value, max(a))
print(min_value)
import numpy as np

a, b, c, d = [int(i) for i in input().split()]

num = np.arange(b - a + 1) + a
print(num[np.logical_and(num % c != 0, num % d != 0)].shape[0])

### FIXED CODE ###

import numpy as np
import math

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

a, b, c, d = [int(i) for i in input().split()]
#
#num = np.arange(b - a + 1) + a
#
#if b < c and b < d:
#    print('0')
#    exit(0)
#
#m = min(c, d)
#div = max(c, d)
#tmp = []
#div = num[0] // div + div
#index = 0
#while True:
#    if n[index] % div != 0:
#        if index + div >
#        tmp += range(n[index], n[index])
#        index += 1
#    else:
#        index += div
#
#tmp = np.array(tmp)
#print(tmp[tmp % m == 0].shape[0])


size = b - a + 1
cd = int(c * d // gcd(c, d))
c_num_a = a // c
d_num_a = a // d
cd_num_a = a // cd
c_num_b = b // c
d_num_b = b // d
cd_num_b = b // cd

c_num = c_num_b - c_num_a
d_num = d_num_b - d_num_a
cd_num = cd_num_b - cd_num_a

if a % c == 0:
    c_num += 1
if a % d == 0:
    d_num += 1
if a % cd == 0:
    cd_num += 1

print(size - c_num - d_num + cd_num)
x = input()
print(x.count('+') - count('-'))

### FIXED CODE ###

x = input()
print(x.count('+') - x.count('-'))
from statistics import mean
import math
def solve():
    N = int(input())
    X = list(map(int, input().split()))
    mn = mean(X)
    if isinstance(mn, int) or mn.is_integer():
        P = mn
        print(calc(X, P))
    else:
        ans = min(calc(X, math.floor(mn)), calc(X, math.ceil(mn)))
        print(ans)

def calc(X, P):
    retval = 0
    for x in X:
        retval += (x - P) ** 2 
    return retval
    
if __name__ == '__main__':
    solve()

### FIXED CODE ###

import math
def solve():
    N = int(input())
    X = list(map(int, input().split()))

    mn = float('inf')
    for i in range(1, 101):
        mn = min(mn, calc(X, i))
    print(mn)


def calc(X, P):
    retval = 0
    for x in X:
        retval += (x - P) ** 2 
    return retval
    
if __name__ == '__main__':
    solve()
a = int(input())
b = int(input())

if a == b[::-1]:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

a = input()
b = input()

if a == b[::-1]:
  print("YES")
else:
  print("NO")
N = input()
s = 0
for i in range(0,2):
  if N[i] = 1:
    s = s + 1
print(s)

### FIXED CODE ###

A = input()
s = 0
for i in range(len(A)):
  if A[i]=="1":
    s = s + 1
print(s)
N = input()
A = map(int,raw_input().split())

for i in range(N-1):
        print A[i],
    print A[-1]

for i in range(1,N):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    for i in range(N-1):
        print A[i],
    print A[-1]

### FIXED CODE ###

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

for i in range(N-1):
    print A[i],
print A[-1]

for i in range(1,N):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    for i in range(N-1):
        print A[i],
    print A[-1]
import sys
from collections import defaultdict
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, = map(int, input().split())
S = [ord("z") - ord(v) + 1 for v in input().strip()]
N, = map(int, input().split())

for i in range(len(S)):
    if S[i] <= N:
        N -= S[i]
        S[i] = 26

S[-1] -= N

print("".join([chr(ord("z") - v + 1) for v in S]))

### FIXED CODE ###

import sys
from collections import defaultdict
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, = map(int, input().split())
S = [ord(v) - ord("a") for v in input().strip()]
N, = map(int, input().split())

for i in range(len(S)):
    c = 26 - S[i]
    if S[i] == 0:
        continue
    if c <= N:
        N -= c
        S[i] = 0

S[-1] += N % 26

print("".join([chr(ord("a") + v) for v in S]))
n, T, *t = map(int, open(0).read().split())
print(sum(min(t[i+1] - t[i], T) for i in range(n)))

### FIXED CODE ###

n, T, *t = map(int, open(0).read().split())
print(sum(min(t[i+1] - t[i], T) for i in range(n-1)) + T)
n = int(input())
h = [list(map(int, input().split()) for _ in range(n)]

dp = np.zeros([n+1, 3])

for i, val in enumerate(h):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i+1, j] = np.max(dp[i+1, j], dp[i, j] + val[k])

print(np.max(dp[n, :], axis=1))

### FIXED CODE ###

import sys
import itertools
from operator import itemgetter #sortedの対象を決めたい
from fractions import gcd #最大公約数
from math import ceil, floor, sqrt, isinf #小数点切り上げ、切り捨て、平方根
from copy import deepcopy #参照で影響されないコピー
from collections import Counter, deque #要素ごとの出現回数、双方向アクセス可能データ型
import heapq
import numpy as np
from functools import reduce
sys.setrecursionlimit(200000)

input = sys.stdin.readline
# template

def retmax(a, b):
    if a > b:
        return a
    else:
        return b

def main():
    n = int(input())
    a = [list(map(int, input().split())) for _ in range(n)]

    dp = np.zeros([3, n+1])

    for i, a_l in enumerate(a):
        for j in range(3):
            for k in range(3):
                if j != k:
                    dp[k, i+1] = retmax(dp[k, i+1], dp[j, i] + a_l[k])

    print(int(np.max(dp[:, n], axis=0)))


if __name__ == "__main__":
    main()
a=list(map(int,input().split()))
a.sort()
print(a[0]+[1])

### FIXED CODE ###

a=list(map(int,input().split()))
a.sort()
print(a[0]+a[1])
X=input("入力1")
t=input("入力2")

y=X-t

print(y)

### FIXED CODE ###

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

print(max(x-t,0))