Harryxun/stf_run huggingface dataset:
x = input().split()
#x = "3 5 0 4 3 6 2 7 2 5 3 3 4 0 5 3 7 5 3 7 2 7 5 7 0 7 2 9 3 2 9 1 3 6 2 0 2 4 6 4 2 3 3 5 7 4 0 6 9 7 6 7 9 8 5 2 2 0 4 7 6 5 5 4 6 3 2 3 0 5 4 3 3 6 2 3 4 2 4 0 8 9 4 6 5 4 3 5 3 2 0 8 2 1 3 4 5 7 8 6 4 0 3 5 2 6 1 2 5 3 2 1 6 9 2 5 6".split()
#x = "2 4 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 2 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 9 9 2 9 9 9 0 9 9 2 9 9 9 9 9 9 9 0 -1 -1 -1 -1 8 1 1 8".split()
h = int(x[0])
w = int(x[1])
d = []
for i in range(10):
    d.append(
        list(map(int, x[2 + i * 10 : 2 + i * 10 + 10]))
    )
a = []
for i in range(h):
    a.append(
        list(map(int, x[102 + i * w: 102 + i * w + w]))
    )
#d = [[0] * 10] * 10
for k in range(10):
    for i in range(10):
        for j in range(10):
            if d[i][j] > d[i][k] + d[k][j]:
                d[i][j] = d[i][k] + d[k][j]

#for k in range(0, 10):
#    print(c[k])
#for k in range(0, 10):
#    print(d[k])
#print(d[8][1])

ans = 0
for i in range(h):
    for j in range(w):
        if a[i][j] != 1 or a[i][j] != -1:
            ans += d[a[i][j]][1]
print(ans)


### FIXED CODE ###

h, w = map(int, input().split())
d = []
for i in range(10):
    d.append(list(map(int, input().split())))
a = []
for i in range(h):
    a.append(list(map(int, input().split())))
for k in range(10):
    for i in range(10):
        for j in range(10):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

#for k in range(0, 10):
#    print(c[k])
#for k in range(0, 10):
#    print(d[k])
#print(d[8][1])

ans = 0
for i in range(h):
    for j in range(w):
        if a[i][j] != -1:
            ans += d[a[i][j]][1]
print(ans)
def resolve():
    N, M, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    def dfs(n, i, j, d, k):
        if k >= K or (i == N and j == M):
            return n
        if d == 1 and i < N and k + A[i] <= K:
            k += A[i]
            l = dfs(n + 1, i + 1, j, d, k)
            if j < M:
                r = dfs(n + 1, i + 1, j, -d, k)
        elif d == -1 and j < M and k + B[j] <= K:
            k += B[j]
            l = dfs(n + 1, i, j + 1, d, k)
            if i < N:
                r = dfs(n + 1, i, j + 1, -d, k)
        else:
            return n

        return max(l, r)

    print(dfs(0, 0, 0, 1, 0))

resolve()

### FIXED CODE ###

def resolve():
    import numpy as np

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

    A = np.insert(np.cumsum(A), 0, 0)
    B = np.insert(np.cumsum(B), 0, 0)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while A[i] + B[j] > K:
            j -= 1

        ans = max(ans, i + j)

    print(ans)

resolve()
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from cmath import phase
from math import gcd
from collections import Counter
def resolve():
    n = int(input())
    zero = 0
    counter = Counter()
    for _ in range(n):
        x, y = map(int, input().split())
        # eliminate 0 vector
        if x == 0 and y == 0:
            zero += 1
            continue
        # standardize (0 <= arg(z) < pi)
        g = gcd(x, y)
        x //= g
        y //= g
        if y < 0:
            x *= -1
            y *= -1
        elif y == 0:
            x, y = 1, 0
        counter[complex(x, y)] += 1

    k = len(counter)
    C = list(counter.items())
    C.sort(key = lambda tup:phase(tup[0]))
    vector = [tup[0] for tup in C]
    count = [tup[1] for tup in C]

    res = 0
    dp = [0] * (k + 1)
    dp[0] = 1
    for i in range(k):
        z = vector[i]
        vert = z.imag - z.real * 1j
        dp[i + 1] += dp[i]
        dp[i + 1] += (pow(2, count[i], MOD) - 1) * dp[i] * pow(2, -counter[vert] % (MOD - 1), MOD)
        dp[i + 1] %= MOD

    res = dp[k]
    res -= 1
    res += zero
    assert(zero > 0)
    print(res % MOD)
resolve()

### FIXED CODE ###

import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from math import gcd
from collections import Counter
from functools import cmp_to_key

def cmp(A1, A2):
    x1, y1 = A1[0]
    x2, y2 = A2[0]
    if (x1, y1) == (x2, y2):
        return 0
    return -1 if x2 * y1 < x1 * y2 else 1

def resolve():
    n = int(input())
    zero = 0
    counter = Counter()
    for _ in range(n):
        x, y = map(int, input().split())
        if x == 0 and y == 0:
            zero += 1
            continue

        g = gcd(x, y)
        x //= g
        y //= g

        if y == 0:
            x, y = 1, 0
        elif y < 0:
            x, y = -x, -y
        counter[x, y] += 1

    C = list(counter.items())
    C.sort(cmp_to_key(cmp))

    k = len(C)
    dp = [0] * (k + 1)
    dp[0] = 1
    for i in range(k):
        x, y = C[i][0]
        dp[i + 1] += dp[i]
        dp[i + 1] += (pow(2, counter[x, y], MOD) - 1) * dp[i] * pow(2, -counter[y, -x] % (MOD - 1), MOD)
        dp[i + 1] %= MOD

    res = dp[k]
    res -= 1
    res += zero
    print(res % MOD)
resolve()
X,Y = map(int, input().split())
for f4 in range(0,X+1,1):
  if Y==(f4*4)+((X-f4)*2):
    print('Yes')

### FIXED CODE ###

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

for i in range(5):
  if (x[i]==0):
    print(i+1)
N=int(input())
A = list(map(int, input().split()))
inf=float('inf')
dp=[inf]*N

def chmin(a,b):
    return min(a,b)

def rec(n):
    if n==0:
        return 0
    if dp[n] < inf:
        return dp[n]
    
    res=rec(n-1) + abs(A[n] - A[n-1])
    if n>1:
        res=chmin(res,rec(n-2) + abs(A[n] - A[n-2]))
    dp[n]=res
    return res

print(rec(N-1))

### FIXED CODE ###

#最初に置いておくもの
import sys
sys.setrecursionlimit(500000) 
input=sys.stdin.readline


N=int(input())
A = list(map(int, input().split()))
inf=float('inf')
dp=[inf]*N

def chmin(a,b):
    return min(a,b)

def rec(n):
    if n==0:
        return 0
    if dp[n] < inf:
        return dp[n]
    
    res=rec(n-1) + abs(A[n] - A[n-1])
    if n>1:
        res=chmin(res,rec(n-2) + abs(A[n] - A[n-2]))
    dp[n]=res
    return res

print(rec(N-1))
N = input()
nums = map(int, input().split())
 
return 1 / sum(1 / num for num in nums)

### FIXED CODE ###

N = input()
nums = map(int, input().split())
 
print(1 / sum(1 / num for num in nums))
a,b = map(int,input().split())
if a >9:
  print(":(")
elif b > 9:
  print(":(")
else:
  print(""Yay!)

### FIXED CODE ###

a = list(map(int,input().split()))
if a[0] <=8 and a[1] <=8:
  print("Yay!")
else:
  print(":(")
a, b = map(int, input().split)

if a > 9 or b > 9:
	print("-1")
else:
	print(a*b)

### FIXED CODE ###

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

if a > 9 or b > 9:
    print("-1")
else:
    print(a*b)
from math import *
import sys

N = int(input())
all_input_list = [list(map(int, input().split())) for i in range(N)]
x, y, h = [all_input_list[i] for i in range(N) if all_input_list[i][2] > 0][0]
for cx in range(101):
    for cy in range(101):
        H = h + abs(cx - x) + abs(cy - y)
        for input_list in all_input_list:
            result = H - abs(cx - input_list[0]) - abs(cy - input_list[1])
            if (result >  0) and (input_list[2] != result):
                break
        else:
            print("%s %s %s" % (cx, cy, H))
            sys.exit(0)


### FIXED CODE ###

print("Hello World") if(input() == "1") else print(int(input()) + int(input()))
# -*- coding:utf-8 -*-
import sys

n = int(input())
command = []
command = [ input().split() for i in range(n)]
ans = []

for i in range(n):
    if command[i][0] == "insert":
        ans.insert(0, command[i][1])
    elif command[i][0] == "delete":
        ans.remove(command[i][1])
    elif command[i][0] == "deleteFirst":
        ans.pop(0)
    else:
        ans.pop()

print (' '.join(ans))

### FIXED CODE ###

# -*- coding:utf-8 -*-
import collections
n = int(input())
ans = collections.deque()

for i in range(n):
    command = input().split()
    if command[0] == "insert":
        ans.appendleft(command[1])
    elif ans == []:
        continue
    elif command[0] == "delete":
        try:
            ans.remove(command[1])
        except:
            pass
    elif command[0] == "deleteFirst":
        ans.popleft()
    else:
        ans.pop()

print (' '.join(ans))
N = int(input())
k = 1
n = 0
while n < N:
    n += k
    k += 1
if n!=N:
    print('No')
    exit()
print('Yes')
print(k)
ans = [[] for _ in range(k)]
v = 1
for i in range(k-1):
    for j in range(i+1,k):
        ans[i].append(v)
        ans[j].append(v)
        v += 1
for row in ans:
    print(len(row)+ *row))


### FIXED CODE ###

N = int(input())
k = 1
n = 0
while n < N:
    n += k
    k += 1
if n!=N:
    print('No')
    exit()
print('Yes')
print(k)
ans = [[] for _ in range(k)]
v = 1
for i in range(k-1):
    for j in range(i+1,k):
        ans[i].append(v)
        ans[j].append(v)
        v += 1
for row in ans:
    print(len(row),*row)
n, k = map(int, input().split())
s = list(input())

# 部分文字列の和を算出
array = []
now_num = 1
count = 0
for i in s:
  if now_num == int(i):
    count += 1
  else:
    array.append(count)
    count = 1
    now_num = 1 - now_num

if count != 0:
  array.append(count)

if len(array) % 2 == 0:
  array.append(0)

res = 0
add = 2 * k + 1
ans = 0
left = 0
right = 0
tmp = 0

for i in range(len(array))[::2]:
    next_left = i
    next_right = min(i+add, len(array))
    # 尺取法
    while next_left > left:
        tmp -= array[left]
        left += 1
    while next_right > right:
        tmp += array[right]
        right += 1
    ans = max(tmp,ans)

print(ans)

### FIXED CODE ###

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

ans =0
if a>=b:
  ans += a
  a = a-1
else:
  ans +=b
  b =b-1
  
if a>=b:
  ans += a
  a = a-1
else:
  ans +=b
  b =b-1
  
print(ans)
n = int(input())
a = list(map(int, input().split()))

end = 0
count = 0
while:
 for i in range(n):
  if a[i]%2 == 1:
   end = 1
   break
  a[i] = a[i]/2
 
 if end == 1: break
 count += 1

print(count)

### FIXED CODE ###

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

end = 0
count = 0

while(True):
 for i in range(n):
  if a[i]%2 == 1:
   end = 1
   break
  a[i] = a[i]/2
 
 if end == 1: break
 count += 1

print(count)
import numpy as np

n = int(input())

# n_list = np.arange(1, n + 1)
# m_list = np.zeros(n)
# m_list[:-1] = n_list[1:]
# m_list[-1] = n_list[0]

n_l = np.arange(1, n + 1)

res = np.cumsum(n_l) 

print(int(res[-2]))


### FIXED CODE ###

n = int(input())
 
print(int(n * (n - 1) // 2))
A,B = map(int,input().split())
if (A+B)%2 == 0:
  pint(int((A+B)//2))
else:
  print(('IMPOSSIBLE')

### FIXED CODE ###

A,B = map(int,input().split())
if (A+B)%2 == 0:
  print(int((A+B)//2))
else:
  print('IMPOSSIBLE')
import copy
[x,n] = list(map(int, input().split()))
pList = list(map(int, input().split()))
dict = {1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0,42:0,43:0,44:0,45:0,46:0,47:0,48:0,49:0,50:0,51:0,52:0,53:0,54:0,55:0,56:0,57:0,58:0,59:0,60:0,61:0,62:0,63:0,64:0,65:0,66:0,67:0,68:0,69:0,70:0,71:0,72:0,73:0,74:0,75:0,76:0,77:0,78:0,79:0,80:0,81:0,82:0,83:0,84:0,85:0,86:0,87:0,88:0,89:0,90:0,91:0,92:0,93:0,94:0,95:0,96:0,97:0,98:0,99:0,100:0}
for i in pList:
    dict[i] = 1
goUp = True
goDown = True
run = True
upTar = copy.copy(x)
lowTar = copy.copy(x)
theAns = copy.copy(x)
while run:
    if dict[lowTar] == 0:
        theAns = lowTar
        break
    if dict[upTar] == 0:
        theAns = upTar
        break
    if goUp:
        upTar += 1
    if goDown:
        lowTar -= 1
    if upTar == 100:
        goUp = False
    if lowTar:
        goDown = False
print(theAns)

### FIXED CODE ###

[x,n] = list(map(int, input().split()))
pList = list(map(int, input().split()))
pSet = set(pList)
step = 0
small = False
big = False
while True:
    if x - step not in pSet:
        small = True
        break
    if x + step not in pSet:
        big = True
        break
    step += 1
if small:
    print(x-step)
else:
    print(x+step)
s = input()
def is_kaibun(s):
  for i in range(len(s)//2):
    if s[i] != s[-i-1]:
      return False
  return True
n = len(s)
s1 = s[:(n-1)/2]
s2 = s[(n+1)/2:]
if is_kaibun(s) & is_kaibun(s1) & is_kaibun(s2):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

s = input()
def is_kaibun(s):
  for i in range(len(s)//2):
    if s[i] != s[-i-1]:
      return False
  return True
n = len(s)
s1 = s[:(n-1)//2]
s2 = s[(n+1)//2:]
if is_kaibun(s) & is_kaibun(s1) & is_kaibun(s2):
  print('Yes')
else:
  print('No')
n = int(input())
num_list = []

for _ in range(n):
    cmd = (input().split())
    if   cmd[0] == 'insert':
        num_list.insert(0,cmd[1])
    elif cmd[0] == 'delete':
        if cmd[1] in num_list:
            num_list.remove(cmd[0])
    elif cmd[0] == 'deleteFirst':
        del(num_list[0])
    else:
        num_list.pop()

print(' '.join(num_list))


### FIXED CODE ###

from collections import deque
dq = deque()
for _ in [None]*int(input()):
    s = input()
    if s == "deleteFirst":
        dq.popleft()
    elif s == "deleteLast":
        dq.pop()
    else:
        a, b = s.split()
        if a == "insert":
            dq.appendleft(b)
        else:
            if b in dq:
                dq.remove(b)
print(" ".join(dq))
import math
import sys
sys.setrecursionlimit(10000000)

n = int(input())
s = int(input())

up = math.sqrt(n)

def colsum(num, base):
    if num <= base:
        return num
    else:
        return num%base + colsum(num//base,base)

#s >= n
if s == n:
    print(n+1)
    exit()
elif s > n:
    print(-1)
    exit()


#sqrt(n)まで探索
for i in range(2,int(up)+1):
    if s == colsum(n,i):
        print(i)
        exit()

#2桁しかあり得ない場合(sqrt(n)<b<n)
for j in range(1,int(up)+1):
    b = int((n-s)/j) + 1
    if s == colsum(n,b) and b > 1:
        print(i)
        exit()

print(-1)

### FIXED CODE ###

import math
import sys

n = int(input())
s = int(input())

up = math.sqrt(n)

def colsum(num, base):
    if num < base:
        return num
    else:
        return num%base + colsum(num//base,base)

#s >= n
if s == n:
    print(n+1)
elif s > n:
    print(-1)
else:
    #sqrt(n)まで探索
    for i in range(2,int(up)+1):
        if colsum(n,i) == s:
            print(i)
            sys.exit()

    #2桁しかあり得ない場合(sqrt(n)<b<n)
    for j in range(int(up),0,-1):
        if (n-s)%j == 0:
            b = (n-s)/j + 1
            if colsum(n,b) == s and b > 1:
                print(int(b))
                sys.exit()

    print(-1)
n = int(input)
s = input()
s2 = s.replace("ABC","")
print(int((len(s)-len(s2))/3))

### FIXED CODE ###

n = int(input())
s = input()
s2 = s.replace("ABC","")
print(int((len(s)-len(s2))/3))
##from scipy.sparse.csgraph import csgraph_from_dense,floyd_warshall
import numpy as np
from itertools import permutations
N,M,R = map(int,input().split())
r = list(map(int,input().split()))

"""
https://juppy.hatenablog.com/entry/2018/11/01/%E8%9F%BB%E6%9C%AC_python_%E5%85%A8%E7%82%B9%E5%AF%BE%E6%9C%80%E7%9F%AD%E7%B5%8C%E8%B7%AF%E6%B3%95%EF%BC%88%E3%83%AF%E3%83%BC%E3%82%B7%E3%83%A3%E3%83%AB%E3%83%95%E3%83%AD%E3%82%A4%E3%83%89%E6%B3%95
"""

def warshall_floyd(d):
    n = len(d)
    #d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d

graph = [[float("inf") for i in range(N)] for j in range(N)] 
for i in range(M):
    A,B,C = map(int,input().split())
    graph[A-1][B-1] = C
    graph[B-1][A-1] = C

dist = warshall_floyd(graph)

ans = 1e10
for i in permutations(r):
    flag = True
    way = list(i)
    tmp = 0
    for i in range(len(way)-1):
        if dist[way[i]-1][way[i+1]-1] < 0:
            flag = False
            break
        tmp += dist[way[i]-1][way[i+1]-1]
    if flag:
        ans = min(tmp,ans)

print(ans)

### FIXED CODE ###

N = input()
if "9" in N:
  print("Yes")
else:
  print("No")
X,Y=input().split()

N=int(input())
 
X=list(map(int,input().split()))
for i in X:
  if i==0:
    print(0)
    exit(0)

result=1
for i in X:
  result*=i
  if result>10**18:
    result=-1
    break
 
print(result)

### FIXED CODE ###

N=int(input())

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

result=1
for i in X:
  result*=i
  if result>10**18:
    result=-1
    break
for i in X:
  if i==0:result=0

print(result)
def index_1_sumall(list):
    return list[1]


n, m = tuple(int(i) for i in input().split(" "))
num_list = [int(i) for i in input().split(" ")]
num_list.sort()
change_list = []
ans_list = []
for j in range(m):
    change_list.append([int(i) for i in input().split(" ")])
change_list.sort(key=index_1_sumall, reverse=1)
break_is = 0
for i in change_list:
    for j in range(i[0]):
        try:
            if i[1] > num_list[0]:
            num_list.pop(0)
            ans_list.append(i[1])
            else:
                break_is = 1
                break
        except IndexError:
            break_is = 1
            break
    if break_is:
        break
num_list.append(0)
print(sum(num_list) + sum(ans_list))


### FIXED CODE ###

def index_1_sumall(list):
    return list[1]


n, m = tuple(int(i) for i in input().split(" "))
num_list = [int(i) for i in input().split(" ")]
num_list.sort()
change_list = []
ans_list = []
for j in range(m):
    change_list.append([int(i) for i in input().split(" ")])
change_list.sort(key=index_1_sumall, reverse=1)
break_is = 0
for i in change_list:
    for j in range(i[0]):
        try:
            if i[1] > num_list[0]:
                num_list.pop(0)
                ans_list.append(i[1])
            else:
                break_is = 1
                break
        except IndexError:
            break_is = 1
            break
    if break_is:
        break
num_list.append(0)
print(sum(num_list) + sum(ans_list))
row=int(input())
T,A=map(int,input().split())
a = list(map(int,input().split()))
ans=100
for i in range(row):
    ans=min(ans,A-T+.006*a[i])
print(a.index(int((ans-A+T)/.006))+1)


### FIXED CODE ###

import sys
input=sys.stdin.readline
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
for i in range(n):
    H[i]=abs(t-H[i]*0.006-a)
L=list(enumerate(H,start=1))
L=sorted(L,key=lambda x:x[1])
print(L[0][0])
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        mods[current % 2019] += 1
        x = x * 10 % 2019
    
    for i in len(mods):
        ans += mods[i] * (mods[i]-1)//2
    print(ans)
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        ans += mods[current % 2019]
        mods[current % 2019] += 1
        x = x * 10 % 2019
    print(ans)

if __name__ == '__main__':
    main()
S = input()
char_list = list(S)
new_list=[]
for char  in char_list:
    char = "x"
    new_list.append(char)
output = "".join(new_list)
print(output)

### FIXED CODE ###

S = input()
char_list = list(S)
new_list=[]
for char  in char_list:
    char = "x"
    new_list.append(char)
output = "".join(new_list)
print(output)
N = map(int, input().split())
H = list(map(int, input().split()))
answer = 0
tmpH = 0
for i in range(N):
    if tmpH <= H[i]:
        answer += 1
        tmpH = H[i]
print(answer)



### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
answer = 0
tmpH = 0
for i in range(N):
    if tmpH <= H[i]:
        answer += 1
        tmpH = H[i]
print(answer)
import math
def cal(n ,r):
    if n == r:
        return 1
    return math.factorial(n)/(math.factorial(r) * math.factorial(n-r))

def bin_search(in_list, val):
    cnt = len(in_list)
    mid = round(cnt/2)
    if cnt == 1:
        return in_list[0]
    if in_list[mid] > val:
        return bin_search(in_list[:mid+1], val)
    if in_list[mid] < val:
        return bin_search(in_list[mid-1:], val)
    if in_list[mid] == val:
        return val

n = int(input())
A = sorted(list(map(int, input().split())))

m_combo = 0
ai = 0
aj = 0

for i in range(1,n):
    a = A[i]
    val = bin_search(A[:i], round(a/2))
    combo = cal(a, val)
    if combo > m_combo:
        m_combo = combo
        ai = a
        aj = val

print('{} {}'.format(ai, aj))


### FIXED CODE ###

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

ai = max(A)
A.remove(ai)

Asub = [abs(ai/2 -a) for a in A]
aj = A[Asub.index(min(Asub))]

print('{} {}'.format(ai, aj))
I = int(intput())
print(24+24-I)

### FIXED CODE ###

I = int(input())
print(24+24-I)
x = int(input())
for a in range(-200, 200):
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == x:
            print(a+" "+b)
            break

### FIXED CODE ###

x = int(input())
for a in range(-200, 200):
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit()
X = int(input())
K = int(input())
D = int(input())
loc = 0
lis = []

def calucu_min(X,K,D):
    for num in range(K) :
        lis.append( abs(abs(2 *D *num -K *D) - abs(X)))
        lis_unique = set(lis)
    print (min(lis_unique))

calucu_min(X,K,D)

### FIXED CODE ###

S = input()
li = list(S)
count = 0
re_num = 0
for num in range(3):
    if li[num] == "R" :
        count = count + 1

if count == 0 :
    re_num = 0
elif count == 1 :
    re_num = 1
elif count == 2 and li[1] == "S" :
    re_num = 1
elif count == 2 and li[1] == "R" :
    re_num = 2
else :
    re_num = 3

print(re_num)
N = int(input())
array1 = []
array2 = []
for i in range(N):
    a,b = map(int,input().split())
    array1.append(a)
    array2.append(b)

array1.sort()
array2.sort()

if N % 2 == 0:
    min = array1[N//2]+array1[N//2+1]
    max = array2[N//2]+array2[N//2+1]
    print(max-min+1)
else:
    min = array1[N//2]
    max = array2[N//2]
    print(max-min+1)


### FIXED CODE ###

N = int(input())
array1 = []
array2 = []
for i in range(N):
    a,b = map(int,input().split())
    array1.append(a)
    array2.append(b)

array1.sort()
array2.sort()

if N % 2 == 0:
    min = array1[N//2]+array1[N//2-1]
    max = array2[N//2]+array2[N//2-1]
    print(max-min+1)
else:
    min = array1[N//2]
    max = array2[N//2]
    print(max-min+1)
N = int(input())
H = map(int, input().split())
 
count = [0]*len(H)
for i in range(len(H)-1):
  if H[i] >= H[i+1]:
    count[i] = 1
    
S = str(count).split('0')
L = map(len, S)
print(max(L))

### FIXED CODE ###

S = input()
T = input()

count = 0
for s,t in zip(S,T):
  if s == t:
    count+=1
    
print(count)
S=str(input())
B=str(input())
if S[:-1:]==B[]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S=str(input())
B=str(input())
if B[:-1:]==S:
    print('Yes')
else:
    print('No')
S = input()

if len(S) < 2:
    print('No')
    return

s = S.replace('hi', '')

# print(S)
print('Yes' if len(s) < 1 else 'No')

### FIXED CODE ###

S = input()

if len(S) < 2:
    print('No')
    exit()

s = S.replace('hi', '')

# print(S)
print('Yes' if len(s) < 1 else 'No')
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
ans = 1
for i in range(n):
  d += l[i]
  if d <= x:
    ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
w = list(map(int, input().split()))
arr = []
for i in range(n):
  a = w[:i]
  b = w[i:]
  arr.append(abs(sum(a) - sum(b)))
print(min(arr))