Harryxun/stf_run huggingface dataset:
if ( a + b == c ) or ( a + c == b ) or ( b + c == a ) :
    print ( "Yes" )
else:
    print ( "No" )

### FIXED CODE ###

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

if ( a + b == c ) or ( a + c == b ) or ( b + c == a ) :
    print ( "Yes" )
else:
    print ( "No" )
n=int(input())
a=list(map(int, input().split()))
a.sort()
print(a[n-1]-a[0])

### FIXED CODE ###

a=int(input())
if (a%2)==0: print(a)
else: print(a*2)
X,Y,Z,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
C.sort(reverse=True)
A_B=[]
SUM=[]
for i in range(X):
  for j in range(Y):
    A_B.append(A[i]+B[j])
A_B.sort(reverse=True)
for i in range(K):
  for j in range(min(K,Z)):
    SUM.append(A_B[i]+C[j])
SUM.sort(reverse=True)
for i in range(K):
  print(SUM[i])

### FIXED CODE ###

X,Y,Z,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
SUM=[]
for i in range(X):
  for j in range(Y):
    for k in range(Z):
      if (i+1)*(j+1)*(k+1)<=K:
        SUM.append(A[i]+B[j]+C[k])
      else:
        break
SUM.sort(reverse=True)
for i in range(K):
  print(SUM[i])
N = int(input())
s = [tuple(map(int, input().split())) for i in range(N)]

s.sort(key=lambda x: x[1])

t = list(map(lambda j:(j[0]-j[1]+1, j[0]+j[1]-1), s))
NN = len(t)
dobon = []

for k, k_l in enumerate(t):
  if k in dobon:
    break
  for l in range(k+1, NN):
    if l in dobon:
      pass
    else:
      if int(k_l[1]) <= int(t[l][1]):
        if (t[l][0] <= k_l[1]) and (k_l[1] <= t[l][1]):
          N -= 1
          dobon.append(l)
          break
      else:
        if (t[l][0] <= k_l[0]) and (k_l[0] <= t[l][1]):
          N -= 1
          dobon.append(l)
          break

print(N)

### FIXED CODE ###

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

if S != 10**9:
  res = [S]*K + [10**9]*(N-K)
else:
  res = [10**9]*K + [1]*(N-K)
  
print(*res)
input()
print(min(sum((x-p)**2 for x in map(int, input().split())) for p in range(101)))


### FIXED CODE ###

def cal_cost(X, P):
    cost = 0
    for x in X:
        cost += (x - P) ** 2
    return cost


def main(N, X):
    return min(cal_cost(X, p) for p in range(max(X) + 1))


if __name__ == "__main__":
    N = int(input())
    X = list(map(int, input().split()))
    ans = main(N, X)
    print(ans)
a,b,c=map(int,input().split())

k=max(a,b,c)

print(int(9k+a+b+c))

### FIXED CODE ###

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

m=max(a,b,c)

print(int(9*m+a+b+c))
import collections

N = int(input())
a = list(map(int, input().split()))
if (len(a) != N or N > 100 or N < 1 or max(a) > 4800 or min(a < 1)):
    exit()

sort = sorted(a, key=int)

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min
max = 8 if max > 8 else max

print(min, max)


### FIXED CODE ###

import collections

N = int(input())
sort = list(map(int, input().split()))

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min


print(min, max)
str = int(input()).split()
a = str[0]
b = str[1]
c = str[2]

if b / a > c:
	print(c)

else:
	print(int(b / a))

### FIXED CODE ###

str = input().split()
a = int(str[0])
b = int(str[1])
c = int(str[2])
 
if b // a > c:
	print(c)
else:
	print(b // a)
import sys
sys.setrecursionlimit(10**9)

n = int(input())
mod = 10**9 + 7

# 再帰だとなんか通らん
# dp = {}
# def rec(i, zero, nine):
#     if (i, zero, nine) in dp:
#         return dp[(i, zero, nine)]
#     if i == n:
#         return 1 if (zero and nine) else 0
#     ret = 0
#     for j in range(10):
#         if j == 0:
#             ret += rec(i + 1, True, nine)
#         elif j == 9:
#             ret += rec(i + 1, zero, True)
#         else:
#             ret += rec(i + 1, zero, nine)
#         ret %= mod
#     dp[(i, zero, nine)] = ret
#     return ret

# print(rec(0, False, False))

dp = [[[0 for _ in range(2)] for _ in range(2)] for _ in range(10**6)]
dp[0][0][0] = 1  # どういう意味なのかは不明
for i in range(n):
    for j in range(2):
        for k in range(2):
            for m in range(10):
                if m == 0:
                    dp[i + 1][1][k] += dp[i][j][k]
                    dp[i + 1][1][k] %= mod
                elif m == 9:
                    dp[i + 1][j][1] += dp[i][j][k]
                    dp[i + 1][j][1] %= mod
                else:
                    dp[i + 1][j][k] += dp[i][j][k]
                    dp[i + 1][j][k] %= mod
print(dp[n][1][1])
# 869121

# 2511445


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

n = int(input())
mod = 10**9 + 7

# 再帰だとなんか通らん
# dp = {}
# def rec(i, zero, nine):
#     if (i, zero, nine) in dp:
#         return dp[(i, zero, nine)]
#     if i == n:
#         return 1 if (zero and nine) else 0
#     ret = 0
#     for j in range(10):
#         if j == 0:
#             ret += rec(i + 1, True, nine)
#         elif j == 9:
#             ret += rec(i + 1, zero, True)
#         else:
#             ret += rec(i + 1, zero, nine)
#         ret %= mod
#     dp[(i, zero, nine)] = ret
#     return ret

# print(rec(0, False, False))

dp = [[[0 for _ in range(2)] for _ in range(2)] for _ in range(10**6 + 10101)]
dp[0][0][0] = 1  # どういう意味なのかは不明
for i in range(n):
    for j in range(2):
        for k in range(2):
            for m in range(10):
                if m == 0:
                    dp[i + 1][1][k] += dp[i][j][k]
                    dp[i + 1][1][k] %= mod
                elif m == 9:
                    dp[i + 1][j][1] += dp[i][j][k]
                    dp[i + 1][j][1] %= mod
                else:
                    dp[i + 1][j][k] += dp[i][j][k]
                    dp[i + 1][j][k] %= mod
print(dp[n][1][1])
# 869121

# 2511445
n = int(input())
s = input()

s = s.rstrip('#')
s = s.lstrip('.')

if len(set(s)) <= 1:
    print(0)
    exit(0)

print(min(s.count('#'), s.count('.')))


### FIXED CODE ###

def seek(n, s):
    s = s.rstrip('#').lstrip('.')
    turn_to_black = s.count('.')
    current_min = turn_to_black
    turn_to_white = 0

    if current_min == 0 or current_min == len(s):
        return 0

    # seek minimum turns to create "^\.*#*$"
    for i in range(len(s)):
        if s[i] == '#':
            turn_to_white += 1
        else:
            turn_to_black -= 1
        current_min = min(current_min, turn_to_black + turn_to_white)
    return current_min


def input_from_console():
    n = int(input())
    s = input()
    return n, s


def main():
    n, s = input_from_console()
    print(seek(n, s))
    

if __name__ == "__main__":
    main()
N=int(input())
array=list(map(int,input().split()))
array1=array.sort()
import itertools
list1=itertools.combinations(array1,3)
ans=0
for n in range(len(list1)):
  if list[n][0]!=list[n][1] and list[n][1]!=list[n][2]:
    if list[n][0]+list[n][1]>list[n][2]:
      ans=ans+1
print(ans)

### FIXED CODE ###

import itertools
n = int(input())
data = list(map(int, input().split()))
data1=sorted(data)
a = list(itertools.combinations(data1,3))
ans=0
for m in range(len(a)):
  if a[m][0]!=a[m][1] and a[m][1]!=a[m][2]:
    if a[m][0]+a[m][1]>a[m][2]:
      ans=ans+1
print(ans)
# -*- coding: utf-8 -*-
import math

A,B = map(int, input().split())
print(math.ceil((b-1)/(a-1)))

### FIXED CODE ###

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

N_cnt = int(input().strip())
H_ary = list(map(int, input().strip().split()))

step_cnt = 0
most_step = 0
for i in range(1,N_cnt):
    if H_ary[i] <= H_ary[i-1]:
        step_cnt += 1
        if most_step < step_cnt:
            most_step = step_cnt
    else:
        step_cnt = 0

print(most_step)
S = input()

ns = []
n = 0
for s in S:
    if s in 'ACGT':
        n += 1
    else:
        ns.append(n)
        n = 0

print(max(ns))

### FIXED CODE ###

S = input()

ns = [0]
n = 0

for s in S:
    if s in 'ACGT':
        n += 1
    else:
        ns.append(n)
        n = 0
ns.append(n)

print(max(ns))
a,b,c = map(int, raw_input().split())

# box1 の許容容量
tmp = a - b
rest = c - tmp

print rest

### FIXED CODE ###

# -*- coding: utf-8 -*-
a,b,c = map(int, raw_input().split())

# box1 の許容容量
tmp = a - b
rest = c - tmp

if rest >= 0:
    print rest
else:
    print 0
s=input()
c=0
if s % 10 ==2:
    c=c+1
s=int((s-(s%10))/10)
if s % 10 ==2:
    c=c+1
s=int((s-(s%10))/10)
if s % 10 ==2:
    c=c+1
s=int((s-(s%10))/10)
if s % 10 ==2:
    c=c+1
s=int((s-(s%10))/10)
print(c)

### FIXED CODE ###

s=int(input())
c=0
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))
if s - int(s/10)*10 ==2:
    c=c+1
s=int(int(s/10))

print(c)
a = y//4
if 2*(x-a)==y-4*a:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x, y = map(int, input().split())
n = (4*x-y)/2
m = (y-2*x)/2
if y%2 ==1:
  print("No")
else:
  if n <0 or m <0:
    print("No")
  else:
    if n+m==x and 2*n+4*m==y:
      print("Yes")
    else:
      print("No")
a, b, k = map(int, input().split())
l = list(range(a,b+1))
la = l[0:k]
lb = l[-k:]

lc = list(set(la + lb))
lc.sort()
for i in range(len(lc)):
  print(lc[i])

### FIXED CODE ###

4,5,6,7,8,9,10
a, b , k = map(int, input().split())
if k > (b-a)//2:
  for i in range(a, b+1):
    print(i)
else:
  for i in range(a, a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(5000):
  a,b = b,a+b
  ref.append(b)
ans = 1
for num in dif:
  ans *= ref[num]
print(ans % 1000000007)

### FIXED CODE ###

n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(100000):
  a,b = b,a+b 
  ref.append(b)
ans = 1
for num in dif:
  ans *= (ref[num] % 1000000007)
print(ans % 1000000007)
while 1
	H , W = map(int , raw_input().split())
	if H == 0 and W == 0:
		break
	print "#" * W
	for h in range(0,H-2):
		s = "#"
		for l in range(0,W-2):
			s += "."
		s += "#"
		print s

	print "#" * W

### FIXED CODE ###

while 1:
	H , W = map(int , raw_input().split())
	if H == 0 and W == 0:
		break
	print "#" * W
	for h in range(0,H-2):
		s = "#"
		for l in range(0,W-2):
			s += "."
		s += "#"
		print s

	print "#" * W
	print
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0 : K] + '...')


### FIXED CODE ###

N = str(input())
numbers = list(N)
if numbers[-1] == '3':
    print("bon")
elif numbers[-1] in ['2', '4', '5', '7', '9']:
    print("hon")
else:
    print("pon")
import sys
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix
from itertools import permutations
read = sys.stdin.read
readline = sys.stdin.readline

N, M, R = map(int, readline().split())
r = list(map(int, readline().split()))
ABC = map(int, read().split())
A, B, C = map(list, zip(*zip(ABC, ABC, ABC)))
A.append(0)
B.append(0)
C.append(0)

csr = csr_matrix((C, (A, B)), (N + 1, N + 1))
distance = shortest_path(csr, directed=False)

answer = 10 ** 9
for tour in permutations(r):
    tmp = 0
    for i, j in zip(tour, tour[1:]):
        tmp += distance[i][j]

    if tmp < answer:
        answer = tmp

print(int(answer))

### FIXED CODE ###

import sys
from scipy.sparse.csgraph import floyd_warshall
from itertools import permutations
read = sys.stdin.read
readline = sys.stdin.readline

N, M, R = map(int, readline().split())
r = list(map(int, readline().split()))

INF = float('inf')
graph = [[INF] * (N + 1) for _ in range(N + 1)]
ABC = map(int, read().split())

for i in range(N + 1):
    graph[i][i] = 0

for A, B, C in zip(*[iter(ABC)] * 3):
    graph[A][B] = C
    graph[B][A] = C

distance = floyd_warshall(graph, directed=False)
answer = 10 ** 9
for tour in permutations(r):
    tmp = 0
    for i in range(R - 1):
        tmp += distance[tour[i]][tour[i + 1]]

    if tmp < answer:
        answer = tmp

print(int(answer))
s = input()
t = input()
print(t+s)

### FIXED CODE ###

s, t = input().split()
print(t + s)
import math
N,P=map(int,input().split())
i=math.ceil(P**(1/N))
while 1:
    if P%(i**N)==0:print(i);exit()
    i-=1


### FIXED CODE ###

import math
def factrization_prime(number):
    factor = {}
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor
N, P = map(int, input().split())
d = factrization_prime(P)
a = 1
for p in d:
    a *= p**(d[p]//N)
print(a)
a = []
for i in range(4):
  a.append(input())
print(min(a[0],a[1]) + min(a[2],a[3])

### FIXED CODE ###

a = []
for i in range(4):
    a.append(input())
print(min(a[0],a[1]) + min(a[2],a[3]))
def Fib(n):    
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return Fib(n-1)+Fib(n-2)

N,M = map(int,input().split())

list=[]
for i in range(M):
    list.append(int(input()))

for i in range(1,len(list)):
    if list[i]-list[i-1] == 1:
        print(0)
        exit()

num_list = []
rest = N
cnt = 0

if M == 0:
    num_list.append(N+1)
else:
    list.sort(reverse = True)
    rest = N + 1
    for i in list:
        num_list.append(rest - i - 1)
        rest = i
    num_list.append(list[-1])

ans = 1
for i in num_list:
    ans = ans * Fib(i+1)
print(ans % 1000000007)


### FIXED CODE ###

N,M = map(int, input().split())

a = [int(input()) for i in range(M)]

#初期化
dp=[-1]*N
dp[0]=1

for i in a:
    dp[i-1] = 0

for i in range(1,N):
    if dp[i]==0:
        continue
    elif i==1:
        dp[i]=dp[i-1] + 1
    else:
        dp[i]=dp[i-1]+dp[i-2]

print(dp[N-1]%1000000007)
import itertools

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

mod = 998244353

m_list = []

for _ in range(k):
    l, r = map(int, input().split())
    t_list = list(range(l,r+1))
    m_list.append(t_list)

m_list = list(itertools.chain.from_iterable(m_list))

dp = [0]*n
dp[0] = 1

for i in range(n):
    for j in range(len(m_list)):
        dp[i] += dp[i-m_list[j]]

print(dp[n-1] % mod)

### FIXED CODE ###

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

mod = 998244353

m_list = []

for _ in range(k):
    m_list.append(list(map(int, input().split())))

dp = [0]*n
dp[0] = 1

dp_sum = [0]*n
dp_sum[0] = 1

for i in range(1, n):
    for j in range(k):
        l, r = m_list[j]
        il = i-l
        ir = i-r-1
        if il < 0:
            continue
        else:
            if ir < 0 :
                dp[i] += dp_sum[il]
            else:
                dp[i] += dp_sum[il] - dp_sum[ir]
            dp[i] %= mod
    dp_sum[i] = dp_sum[i-1] + dp[i]
    dp_sum[i] %= mod

print(dp[n-1] % mod)
import math
n, m = map(long, input().split())
kotae=1

for i in range(1,long(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m/i)*n<=m:
			kotae=max(kotae, m/i)
print(kotae)

### FIXED CODE ###

import math
n, m = map(int, input().split())
kotae=1

for i in range(1,int(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m//i)*n<=m:
			kotae=max(kotae, m//i)
print(kotae)
def calc(n,k):
    while n[0] == '0' :n=n[1:]
    
    digit = len(n)
    if digit < k:
        return 0
    
    comb = [1]*(k+1)
    for i in range(1,k+1):
        comb[i] = comb[i-1] * (digit-i) //i
    if k==1:
        return 9*comb[1] + int(n[0])
    elif k==2:
        return (9**2)*comb[2] + (int(n[0])-1) * 9*comb[1] + calc(n[1:],1)
    elif k==3:
        return (9**3)*comb[3] + (int(n[0])-1) * (9**2) * comb[2] + calc(n[1:],2)

n=input()
k=int(input())
print(calc(n,k))

### FIXED CODE ###

def calc(n,k):
    while n[0] == '0' and len(n)>1:
        n=n[1:]
    
    digit = len(n)
    if digit < k:
        return 0
    
    comb = [1]*(k+1)
    for i in range(1,k+1):
        comb[i] = comb[i-1] * (digit-i) //i
    if k==1:
        return 9*comb[1] + int(n[0])
    elif k==2:
        return (9**2)*comb[2] + (int(n[0])-1) * 9*comb[1] + calc(n[1:],1)
    elif k==3:
        return (9**3)*comb[3] + (int(n[0])-1) * (9**2) * comb[2] + calc(n[1:],2)

n=input()
k=int(input())
print(calc(n,k))
N,M = map(int, input().split())
A = [0] * M
for i in M:
  A[i] = int(input())
  N -= A[i]

if N < 0:
  N = -1

print(N)

### FIXED CODE ###

N,M = map(int, input().split())
A = list(map(int, input().split()))
N -= sum(A)
if N >= 0:
  print(N)
else:
  print(-1)
N = int(input())
A = list(map(int,input().split()))
ans = 0
a = 0
max_flag = False
for l in range(N):
    a = A[l]
    x = A[l]
    for j in range(l+1,N):
        a += A[j]
        x = x ^ A[j]
        if a == x:
            ans += 1
        else
            break
print(ans + N)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
num = 0
a = 0
x = 0
k = 0
for l in range(N):
    for j in range(k,N):
        a += A[j]
        x =  x ^ A[j]
        if a  != x:
            ans += j - l
            k = j
            x = x ^ A[l] ^ A[j]
            a = a - A[l] - A[j]
            break
        elif j == N-1:
            ans += N-l
            k = j
            x = x ^ A[l] ^ A[j]
            a = a - A[l] - A[j]
print(ans )
s = list(input())
s.sort()
if len(len(s))!=4:
  print("No")
elif s[0]==s[1] and s[2]==s[3]:
  	print("Yes")
else:
  	print("No")

### FIXED CODE ###

s = set(input())
print('Yes' if len(s) == 2 else 'No')
from collections import Counter
A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
A=[A1,A2,A3]
N=int(input())
for _ in range(N):
  b=int(input())
  #穴をあける
  for tmpA in A:
    if b in tmpA:
      index=tmpA.index(b)
      tmpA[index]=-1
      break
  
#bingoチェック
  
#たて
if True in [ not False in [A[j][i]==A[j+1][i] for j in range(len(A)-1)] for i in range(len(A[0]))]:
  print("Yes")
#よこ
elif True in [len(Counter(tmpA))==1 for tmpA in A]:
  print("Yes")
#ななめ
elif not False in [A[i][i] == A[i+1][i+1]for i in range(len(A)-1)] or not False in  [A[len(A)-(i+1)][i] == A[len(A)-(i+2)][i+1]for i in range(len(A)-1)]
  print("Yes")
#ダメ
else:
  print("No")

### FIXED CODE ###

from collections import Counter
A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
A=[A1,A2,A3]
N=int(input())
for _ in range(N):
  b=int(input())
  #穴をあける
  for tmpA in A:
    if b in tmpA:
      index=tmpA.index(b)
      tmpA[index]=-1
      break
  
#bingoチェック
#中央が空いている
if A[1][1]==-1:
  #ななめ
  if A[0][0] == A[2][2] or A[0][2]==A[2][0]:
    print("Yes")
  #たてよこ
  elif A[0][1]==A[2][1] or A[1][0]==A[1][2]:
    print("Yes")
#中央が空いていない
else:
  #たて
  if A[0][0]==A[1][0] and A[1][0]==A[2][0] or A[0][2]==A[1][2]and A[1][2]==A[2][2]:
    print("Yes")
   #よこ
  elif len(Counter(A[0]))==1or len(Counter(A[2]))==1:
    print("Yes")
  else:
    print("No")
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
d = [list(map(int,input().split())) for i in range(n)]
d.sort(key = lambda x:x[0])
d.sort(key = lambda x:x[1],reverse=True)

from heapq import heappush, heappop
hq = []
for i,ab in enumerate(d):
    heappush(hq,(i,ab))

cur_dat = 1
ret = 0
while cur_dat <= m:
    val = heappop(hq)[1]
    if val[0] <= cur_dat:
        ret+=val[1]
    else:
        heappush(hq,val)
    cur_dat+=1
print(ret)


### FIXED CODE ###

# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))

from collections import defaultdict
from heapq import heappush, heappop
dd = defaultdict(list)

for _ in range(n):
    a,b = tuple(map(int,input().split()))
    dd[a].append(b)

hq = []
ret = 0
for i in range(1,m+1):
    for j in dd[i]:
        heappush(hq,-j)
    if hq:
        ret+=heappop(hq)
print(-ret)
While True:
    h,w=map(int, input().split())
    if h == 0 and w == 0:
        quit()
    for i in range(h):
        print('#'*w)
    print()

### FIXED CODE ###

while True:
    h,w=map(int, input().split())
    if h == 0 and w == 0:
        quit()
    for i in range(h):
        print('#'*w)
    print()
s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != "1":
        break
if k < i:
    pirnt(1)
else:
    print(s[i])


### FIXED CODE ###


s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != "1":
        break
if k - 1 < i:
    print(1)
else:
    print(s[i])
W, H, x, y, r = [int(i) for i in input().split]


if x-r < 0:
    print("No")
elif x-r >= 0 and x + r < W:
    print("Yes")

### FIXED CODE ###

W, H, x, y, r = [int(i) for i in input().split()]


if x + r <= W and y - r >= 0 and x - r >= 0 and y + r <= H:
    print("Yes")
else:
    print("No")
q=int(input())
cnt1=0
for i in range(q):
    query=list(input().split())
    if int(query[0])==1:
        cnt1+=1
    else:
        if (int(query[1])+cnt1)%2==0:
            s.join(query[2])
        else:
            query[2].join(s)
if cnt1%2==0:
    print(s)
else:
    s2=""
    for i in range(len(s)):
        s2.join(s[-1-i])
    print(s2)


### FIXED CODE ###

s=input()
q=int(input())
cnt1=0
s_mae=[]
s_ushiro=[]
for i in range(q):
    query=list(input().split())
    if int(query[0])==1:
        cnt1+=1
    else:
        if (int(query[1])+cnt1)%2==0:
            s_ushiro.append(query[2])
        else:
            s_mae.append(query[2])
s1=""
for i in range(len(s_mae)):
    s1=s1+s_mae[-1-i]
s2="".join(s_ushiro)
ans=s1+s+s2
if cnt1%2==0:
    print(ans)
else:
    ans2=""
    for i in range(len(ans)):
        ans2=ans2+ans[-1-i]
    print(ans2)
a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a and a<=12:
    print(int(b/2)a)
else:
    print(b)

### FIXED CODE ###

a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a and a<=12:
    print(int(b/2))
else:
    print(b)
n,k=map(int,input().split())

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

fumi = set([0])
start = None
end = None
aab = [0]
for i in range(1*10**5):
    next = aa[aab[-1]] - 1
    if next in fumi:
        if start is None:
            start = i
            fumi = set()
        else:
            end = i
            break
    aab.append(next)
    fumi.add(next)

random_first = len(aab) - 2*(end - start)
#print(aab, start, end, aab[start+1:end+1], aab[:random_first])

first = aab[:random_first]
one_cicle = aab[start+1:end+1]
if k <= len(first):
    print(first[k]+1)
else:
    k = k-len(first)
    print(one_cicle[k%len(one_cicle)]+1)

### FIXED CODE ###

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

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

fumi = set([0])
start = None
end = None
aab = [0]
for i in range(10**18):
    next = aa[aab[-1]] - 1
    if next in fumi:
        if start is None:
            start = i
            fumi = set()
        else:
            end = i
            break

    aab.append(next)
    fumi.add(next)
    if i+1 == k:
        print(next+1)
        exit(0)

random_first = len(aab) - 2*(end - start)
#print(aab, start, end, aab[start+1:end+1], aab[:random_first])

first = aab[:random_first]
one_cicle = aab[start+1:end+1]
if k <= len(first):
    print(first[k]+1)
else:
    k = k-len(first)
    print(one_cicle[k%len(one_cicle)]+1)
S = input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
  print("Bad")
  else:
    print("Good")


### FIXED CODE ###

S = input()

if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
   print("Bad")
else:
    print("Good")
n = input()
if n[1:] == "9"*(len(n)-1) :
    l = list(n)
    print(sum(n))
else :
    l = list(n)
    ans = (len(n)-1) * 9 + int(l[0]) - 1
    print(ans)

### FIXED CODE ###

n = input()
if n[1:] == "9" * (len(n)-1) :
    print(int(n[0])+9*(len(n)-1))
else :
    print(int(n[0])+9*(len(n)-1)-1)