Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(100000) 

n,m = list(map(int,input().split()))
a = [0]*m
for i in range(m):
    a[i] = int(input())
memo = [-1]*(n+1)

for i in a:
    memo[i] = 0

def stair(k):
    if memo[k] != -1:
        return memo[k]
    else:
        if k == 1:
            if 1 not in a:
                memo[k] = 1
        elif k == 2:
            if 2 not in a:
                memo[k] = 1 + memo[1]
            else:
                memo[k] = 0 + memo[1]
        elif k not in a:
            if k-1 not in a or k-2 not in a:
                    memo[k] = (stair(k-1)+stair(k-2))%1000000007
        return memo[k]

print(stair(n))

### FIXED CODE ###

n,m = list(map(int,input().split()))
a = [0]*m
for i in range(m):
    a[i] = int(input())
dp = [0]*(n+2)
for i in a:
    dp[i] = -1
dp[0] = 1

for i in range(n):
    if dp[i]<0:
        continue
    dp[i] %= 10**9+7
    if dp[i+1]>=0:
        dp[i+1] += dp[i]
    if dp[i+2]>=0:
        dp[i+2] += dp[i]
print(dp[n]%(10**9+7))
N = int(input())
A = list(map(int, input().split()))
M = min(A)

if M == 1:
    A.pop(1)
tmp = 1
for i in reversed(range(2,M+1)):
    count = 0
    memo = 0
    for j in range():
        if A[j]%i != 0:
            count += 1
            memo = j
            if count > 1:
                break
    if count <= 1:
        tmp = i
        break
        

print(tmp)



### FIXED CODE ###

def gcd(a,b):
    if a <= b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    else:
        return gcd(b,a%b)

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

L_gcd = [0]*(N+1)
R_gcd = [0]*(N+1)

for i in range(N):
    L_gcd[i+1] = gcd(L_gcd[i],A[i])
    R_gcd[N-i-1] = gcd(R_gcd[N-i],A[N-i-1])

ans = 0
for i in range(N):
    if gcd(L_gcd[i],R_gcd[i+1])>ans:
        ans = gcd(L_gcd[i],R_gcd[i+1])
    
print(ans)
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
z=(v*t)+a
y=(w*t)+b
if w>=v:
    print("NO")
    break
if z-y>=0:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
z=(v*t)
y=(w*t)
if z-y>=abs(b-a):
    print("YES")
else:
    print("NO")
a,b,c,d=map(int,input().split())
import math
cc=b//c-(a-1)//c
dd=b//d-(a-1)//d
gcd=math.gcd(c,d)
lcm=c*d//gcd
cd=b//lcm-a//lcm
print((b-a+1)-(cc+dd-cd))

### FIXED CODE ###

a,b,c,d=map(int,input().split())
import fractions as f
cc=b//c-(a-1)//c
dd=b//d-(a-1)//d
gcd=f.gcd(c,d)
lcm=c*d//gcd
cd=b//lcm-(a-1)//lcm
print((b-a+1)-(cc+dd-cd))
t=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
p,q=[0],[0]
x,y=[(a[0]-b[0])*t[0],(a[1]-b[1])*t[1]]
#print(x,y,abs(x)<abs(y))
#exit()
if x+y==0:
    print("infinity")
elif (x<0 and y<0) or (x>0 and y>0):
    print(0)
elif (x<0 and x+(x+y)>0) or (x>0 and x+(x+y)<0):
    print(1)
elif x<0 and x+y>0:
    print((abs(x)//(x+y))*2+[0,1][abs(x)%(x+y)>1])
elif x<0 and x+y<0:
    print((y//abs(x+y))*2)
elif x<0 and x+y<0:
    print((y//abs(x+y))*2)
else:
    print(hhh)

### FIXED CODE ###

T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())
 
P = (A1 - B1) * T1
Q = (A2 - B2) * T2
if P > 0:
	P *= -1
	Q *= -1
 
if P + Q < 0:
	print(0)
elif P + Q == 0:
	print("infinity")
else:
	S = (-P) // (P + Q)
	T = (-P) % (P + Q)
	if T != 0:
		print(S * 2 + 1)
	else:
		print(S * 2)
def get_verteces_in_subtree(vertex):
    children = tree_dictionary[vertex]
    if len(children) == 0:
        return [vertex]
    return [vertex] + sum([get_verteces_in_subtree(child) for child in children], [])

N, Q = list(map(int, input().split()))
edges = [list(map(int, input().split())) for _ in range(N-1)]
operations = [list(map(int, input().split())) for _ in range(Q)]

tree_dictionary = {i: [] for i in range(1, N+1)}
for edge in edges:
    tree_dictionary[edge[0]].append(edge[1])

counts = [0] * N
for op in operations:
    top_vertex, value = op
    added_verteces = get_verteces_in_subtree(top_vertex)
    for v in added_verteces:
        counts[v-1] += value

output = ""
for c in counts:
    output += (str(c) + " ")
output = output[:-1]
print(output)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6) #for deep recursion

N, Q = list(map(int, input().split()))
edges = [list(map(int, input().split())) for _ in range(N-1)]
operations = [list(map(int, input().split())) for _ in range(Q)]

counts = [0] * N
for op in operations:
    p, x = op
    counts[p-1] += x
    
all_connected_vertices = {i: [] for i in range(1, 1+N)}
for a, b in edges:
    all_connected_vertices[a].append(b)
    all_connected_vertices[b].append(a)
    
def dfs(point, pre):
    connected_vertices = all_connected_vertices[point]
    for c in connected_vertices:
        if c == pre:
            continue
        counts[c-1] += counts[point-1]
        dfs(c, point)
    
dfs(1, -1)
    
print(*counts)
root = int(input())
ranges = list(map(int, input().slice()))
flag = False

for i in range(ranges[0], ranges[1] + 1):
    if i % root:
        flag = True
        
if flag: 
    print('OK')
else:
    print('NG')


### FIXED CODE ###

root = int(input())
ranges = list(map(int, input().split()))
flag = False

for i in range(ranges[0], ranges[1] + 1):
    if i % root == 0:
        flag = True
        
if flag: 
    print('OK')
else:
    print('NG')
N = int(input())
a = list(map(int, input().split()))

b = []

for i in range(1, N+1)[::-1]:
    if len(list(filter(lambda x: x % i == 0, b))) % 2 != a[i-1]:
        b += [i]

print(len(b))
ans = ""
for i in range(len(b) - 1):
    ans += str(b[i])
    ans += " "
ans += str(b[-1])
print(ans)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = [0 for _ in range(N + 1)]
x = []

for n in range(N):
    i = N - n
    BB = B[::i]
    if (sum(BB)) % 2 == A[i - 1]:
        B[i] = 0
    else:
        B[i] = 1
    if B[i] == 1:
        x.append(str(i))

if len(x) == 0:
    print(0)
else:
    print(len(x))
    print(' '.join(x))
a=input()
b=input()
s=a+b
if s>9 :
    print('error')
else :
    print(s)


### FIXED CODE ###


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

s=a+b


if s>=10 :
    print("error")
else :
    print(s)
import sys
sys.setrecursionlimit(10**7)

from functools import lru_cache
S = input()


@lru_cache
def solve(i, prev, K):
    if i >= N:
        return K
    ret = 0
    if S[i] != prev:
        ret = max(ret, solve(i+1, S[i], K+1))
    if S[i:i+2] != prev:
        ret = max(ret, solve(i+2, S[i:i+2], K+1))
    return ret


print(solve(0, '', 0))


### FIXED CODE ###

S = input()

ans = 0
prev = ''
curr = ''
for s in S:
    curr += s
    if prev != curr:
        ans += 1
        prev = curr
        curr = ''
print(ans)
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
time = 0
count = 0
i = 0
j = 0
while time <= K:
    if A[i]>=B[j]:
        time += B[j]
        if time <= K:
            j +=1
            count +=1
    elif A[i] < B[j]:
        time += A[i]
        if time <= K:
            i +=1
            count +=1
print(count)

### FIXED CODE ###

N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = [0]
b = [0]
ans = 0
max_num = 0
j = M
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
for i in range(N+1):
    if a[i] > K:
        break
    else:
        while b[j] > K - a[i]:
            j -=1
            if j <0:
                break
    if K>= a[i] + b[j]:
        ans = max(ans,i + j)
print(ans)
from itertools import combinations
from bisect import bisect_left
N,Ma,Mb = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(N)]
if N==1:
    if A[0][0]*Mb==A[0][1]*Ma:
        print(A[0][2])
    else:
        print(-1)
else:
    A1 = A[:N//2]  # N//2
    A2 = A[N//2:]  # N-N//2
    B1 = []
    for k in range(1,N//2+1):
        for x in combinations(range(N//2),k):
            cnt1 = 0
            cnt2 = 0
            for i in x:
                cnt1 += Ma*A1[i][1]-Mb*A1[i][0]
                cnt2 += A1[i][2]
            B1.append((cnt1,cnt2))
    B2 = []
    for k in range(1,N-N//2+1):
        for x in combinations(range(N-N//2),k):
            cnt1 = 0
            cnt2 = 0
            for i in x:
                cnt1 += Ma*A2[i][1]-Mb*A2[i][0]
                cnt2 += A2[i][2]
            B2.append((cnt1,cnt2))
    B1 = sorted(B1,key=lambda x:x[1])
    B1 = sorted(B1,key=lambda x:x[0])
    B2 = sorted(B2,key=lambda x:x[1])
    B2 = sorted(B2,key=lambda x:x[0])
    cmin = 10000
    for b1 in B1:
        b,c = b1[0],b1[1]
        ind = bisect_left(B2,(-b,0))
        if B2[ind][0]==-b:
            cmin = min(cmin,c+B2[ind][1])
    if cmin>=10000:
        print(-1)
    else:
        print(cmin)

### FIXED CODE ###

INFTY = 10**4
N,Ma,Mb = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(N)]
dp = [[[INFTY for _ in range(401)] for _ in range(401)] for _ in range(N+1)]
dp[0][0][0] = 0
for i in range(1,N+1):
    for j in range(401):
        for k in range(401):
            dp[i][j][k] = dp[i-1][j][k]
            a = A[i-1][0]
            b = A[i-1][1]
            c = A[i-1][2]
            if j>=a and k>=b:
                dp[i][j][k] = min(dp[i][j][k],dp[i-1][j-a][k-b]+c)
cmin = INFTY
for j in range(1,401):
    for k in range(1,401):
        if j*Mb==k*Ma:
            cmin = min(cmin,dp[N][j][k])
if cmin>=INFTY:
    print(-1)
else:
    print(cmin)
a=int(input())
b=int(input())
c=int(input())

if a == b and b == c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if a == b and b == c:
    print("Yes")
else:
    print("No")
a,b=int(input().split())

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)
    

### FIXED CODE ###

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)
n=int(input())
visitedlist=[-1 for  i in range(n)]
kilist=[[] for i in range(n)]
anslist=[0 for i in range(n)]
searchedlist=[-1 for i in range(n)]

for i in range(n-1):
        a,b,c=map(int,input().split())
        kilist[a-1].append((b,c))
        kilist[b-1].append((a,c))
def search(i):
        searchedlist[i-1]=1
        visitedlist[i-1]=1
        flag=0
        for j in kilist[i-1]:
            if visitedlist[j[0]-1]<0:
                visitedlist[j[0]-1]=1
                flag+=1
                anslist[j[0]-1]=anslist[i-1]+j[1]
        else:
            pass

        if flag>0:    
            for k in kilist[i-1]:
                if searchedlist[k[0]-1]==-1:
                    search(k[0])
search(2)
for i in anslist:
	print(i%2)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

n=int(input())
visitedlist=[-1 for  i in range(n)]
kilist=[[] for i in range(n)]
anslist=[0 for i in range(n)]
searchedlist=[-1 for i in range(n)]
for i in range(n-1):
        a,b,c=map(int,input().split())
        kilist[a-1].append((b,c))
        kilist[b-1].append((a,c))
def search(i):
        searchedlist[i-1]=1
        visitedlist[i-1]=1
        flag=0
        for j in kilist[i-1]:
            if visitedlist[j[0]-1]<0:
                visitedlist[j[0]-1]=1
                flag+=1
                anslist[j[0]-1]=anslist[i-1]+j[1]
        else:
            pass

        if flag>0:    
            for k in kilist[i-1]:
                if searchedlist[k[0]-1]==-1:
                    search(k[0])
search(2)
for i in anslist:
    print(i%2)
def main():
    N = int(input())
    S = [[] * N for i in range(N)]
    ans = 0

    for i in range(N):
        A = int(input())
        for j in range(A):
            x, y = map(int, input().split())
            S[i].append([x-1, y])

    P = [0]*N

    for i in range(2**N):
        for j in range(N):
            if P[j] == 0:
                P[j] = 1
                break
            else:
                P[j] = 0

        if sum(P) <= ans:
            continue
        flag = 0
        for p in range(len(P)):
            if P[p] == 1:
                for s in S[p]:
                    if s[1]!= P[s[0]]:
                        flag = 1
        if flag == 1:
            continue
        else:
            ans = sum(P)

    print(ans)


 
if name == 'main':
    main()


### FIXED CODE ###

def main():
    N = int(input())
    S = [[] * N for i in range(N)]
    ans = 0

    for i in range(N):
        A = int(input())
        for j in range(A):
            x, y = map(int, input().split())
            S[i].append([x-1, y])

    P = [0]*N
    
    for i in range(2**N):
        for j in range(N):
            if P[j] == 0:
                P[j] = 1
                break
            else:
                P[j] = 0
        
        if sum(P) <= ans:
            continue
        flag = 0
        for p in range(len(P)):
            if P[p] == 1:
                for s in S[p]:
                    if s[1]!= P[s[0]]:
                        flag = 1
        if flag == 1:
            continue
        else:
            ans = sum(P)
        
    print(ans)


 
if __name__ == '__main__':
    main()
N = int(input())
a = [input() for i in range(N)]

now = 1
count = 0

for i in range(N):
    if now != 2:
        now = int(a[now-1])
        count += 1
    else:
        print(count)
        break

if count == loop:
    print(-1)


### FIXED CODE ###

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

now = 1
count = 0

for i in range(N):
    if now != 2:
        now = int(a[now-1])
        count += 1
    else:
        print(count)
        break

if count == N:
    print(-1)
a = int(input())
b = int(input())
print("GREATER" if a > b else "EQUAL" if a == b else "LESS") 

### FIXED CODE ###

a,b,c = input().split()
print(a[0].upper()+b[0].upper()+c[0].upper())
N = int(input())

import numpy as np

G = np.array([list(map(int,input().split())) for i in range(N)])

import scipy.sparse.csgraph as csg

G2 = csg.floyd_warshall(G,directed=False)

if np.any(G != G2):
  print(-1)
else:
  G = G2
  T = csg.minimum_spanning_tree(G)
  total = np.sum(T)
  T = csg.floyd_warshall(T,directed=False,overwrite=True)

  import heapq as hq

  remaining = []
  delta = T!=G

  indices = set()
  for i,j in zip(*np.nonzero(delta)):
    indices.add(i)
    if i > j:
      remaining.append((G[i,j],i,j))
  
  hq.heapify(remaining)
  while remaining:
    d,i,j = hq.heappop(remaining)
    delta[i,j] = True
    delta[j,i] = True
    if d != T[i,j]:
      T[i,j] = d
      T[j,i] = d
      total += d
      T2 = csg.dijkstra(T,directed=False,indices=list(indices))
      for i,j in enumerate(indices):
        T[j] = T2[i]
    
    if np.all(delta[i]):
      indices.remove(i)
    if np.all(delta[j]):
      indices.remove(j)

  print(int(total))

### FIXED CODE ###


N = int(input())

import numpy as np

G = np.array([list(map(int,input().split())) for i in range(N)], dtype=np.uint32)

import scipy.sparse.csgraph as csg

G2 = csg.floyd_warshall(G,directed=False)

if np.any(G != G2):
  print(-1)
else:
  G[G==0] = 2*10**9
  t = 0
  for i in range(N):
    for j in range(i+1,N):
      n = np.min(G[i]+G[j])
      if n > G[i,j]:
        t += G[i,j]


  print(t)
N=int(input())
A=list(map(int,input().split()))

A[0]=A[0]-1
A[1]=A[1]-1
sum=0

for a in A:
    if a>0:
        sum+=a

print(sum)


### FIXED CODE ###

a,b,t=map(int,input().split())
x=0
num=0
c=a
for i in range(21):
    x=c
    c=a*(i+2)
    #print(x)
    if(x>t):
        break
    num+=b

print(num)
n=input()
n.sort()
if n="abc":
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n=list(input())
n.sort()
a=n[0]+n[1]+n[2]
if a=="abc":
    print("Yes")
else:
    print("No")
mport numpy as np

n = input()
s = []
for i in range(n):
    s.append(raw_input())
for i in range(n):
    s[i] = list(s[i])
    s[i].sort()
print s
#print s[0][1] in s[1]
#print len(s[0])
#print s[0][1]
#print s[2]
count = 0
answer = []
for j in range(len(s[0])):
    for k in range(1,n):
        if ''.join(s[k]).find(s[0][j]) != -1:
            count += 1
    if count == n-1:
        answer.append(s[0][j])
    print count
    count = 0
print ''.join(answer)

### FIXED CODE ###

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

if b-a == c-b:
    print 'YES'
else:
    print 'NO'
x=input()
dic={'A':'T',
      'C':'G',
      'G':'C',
      'T':,'A',
     }

print(dic[x])

### FIXED CODE ###

x=input()
dic={'A':'T',
      'C':'G',
      'G':'C',
      'T':'A',
     }
 
print(dic[x])
ans_list = []
n = int(input())

def mcxl2digit(s):
    ans = 0
    dig = 1
    for i in range(len(s)):
        if "2" <= s[i] <= "9":
            dig = int(s[i])
        else:
            if s[i] == "m":
                key = 100
            elif s[i] == "c":
                key = 100
            elif s[i] == "x":
                key = 10
            else:
                key = 1
            ans += key * dig
            dig = 1
    return ans

def digit2mcxl(i):
    return_list = []
    m = i // 1000
    if m != 0 and m != 1:
        return_list.append(str(m))
    if m != 0:
        return_list.append("m")
    i = i % 1000

    c = i // 100
    if c != 0 and c != 1:
        return_list.append(str(c))
    if c != 0:
        return_list.append("c")
    i = i % 100

    x = i // 10
    if x != 0 and x != 1:
        return_list.append(str(x))
    if x != 0:
        return_list.append("x")
    i = i % 10

    l = i
    if l != 0 and l != 1:
        return_list.append(str(l))
    if l != 0:
        return_list.append("l")

    return return_list

for i in range(n):
    a, b = input().split()
    ans = (mcxl2digit(a) + mcxl2digit(b))
    ans = digit2mcxl(ans)
    ans_list.append(ans)
for i in ans_list:
    print("".join(i))


### FIXED CODE ###

ans_list = []
n = int(input())

def mcxl2digit(s):
    ans = 0
    dig = 1
    for i in range(len(s)):
        if "2" <= s[i] <= "9":
            dig = int(s[i])
        else:
            if s[i] == "m":
                key = 1000
            elif s[i] == "c":
                key = 100
            elif s[i] == "x":
                key = 10
            else:
                key = 1
            ans += key * dig
            dig = 1
    return ans

def digit2mcxl(i):
    return_list = []
    m = i // 1000
    if m != 0 and m != 1:
        return_list.append(str(m))
    if m != 0:
        return_list.append("m")
    i = i % 1000

    c = i // 100
    if c != 0 and c != 1:
        return_list.append(str(c))
    if c != 0:
        return_list.append("c")
    i = i % 100

    x = i // 10
    if x != 0 and x != 1:
        return_list.append(str(x))
    if x != 0:
        return_list.append("x")
    i = i % 10

    l = i
    if l != 0 and l != 1:
        return_list.append(str(l))
    if l != 0:
        return_list.append("i")

    return return_list

for i in range(n):
    a, b = input().split()
    ans = (mcxl2digit(a) + mcxl2digit(b))
    #print(a, b, mcxl2digit(a), mcxl2digit(b))
    #print(ans)
    ans = digit2mcxl(ans)
    ans_list.append(ans)
for i in ans_list:
    print("".join(i))
n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
    if s[i]=="I":
        x+=1
        a.append(x)
    else:
        x-=1
        a.append(x)
a=list(set(a))
b=a.reverse()
print(b[0])

### FIXED CODE ###

n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
    if s[i]=="I":
        x+=1
        a.append(x)
    else:
        x-=1
        a.append(x)
a=sorted(list(set(a)))
print(a[-1])
import heapq
import sys
input=sys.stdin.readline
from collections import defaultdict
h, w, d = map(int, input().split())
p = dict()
D = defaultdict(list)
for i in range(h):
    for j, x in enumerate(map(int, input().split())):
        p[x] = (x, i, j)
        heapq.heappush(D[x%d], (x, i, j))

q = int(input())
for i in range(q):
    a, b = map(int, input().split())
    v = D[a%d]
    ans = 0
    for x, i, j in v:
        if x == a:
            s, t = i, j
        elif a < x <= b:
            ans += abs(s-i)+abs(t-j)
            s, t = i, j
            if x == b:
                break
    print(ans)


### FIXED CODE ###

import sys
input=sys.stdin.readline
h, w, d = map(int, input().split())
p = dict()

for i in range(h):
    for j, x in enumerate(map(int, input().split())):
        p[x] = (i, j)

dp = [0]*(h*w+1)
for i in range(h*w+1):
    if d < i:
        dp[i] = dp[i-d] + abs(p[i][0]-p[i-d][0])+abs(p[i][1]-p[i-d][1])

q = int(input())
for i in range(q):
    a, b = map(int, input().split())
    ans = dp[b]-dp[a]
    print(ans)
def coin(a, b, c):

    global count
    global m

    if a % c[0] == 0:

        count = min(count, b + a // c[0])

        return count

    elif b + a // c[0] >= count:

        return n

    elif c[0] < n:

        return min(cs(a - c[0], b + 1, c), cs(a, b, c[1:]))

    else:

        return coin(a, b, c[1:])


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

money = sorted(list(map(int, input().split())), reverse = True)

count = print(coin(n, 0, money))


### FIXED CODE ###

def coin(n, p, c):
    global count
    global m
    if n % c[0] == 0:
        count = min(count, p + n // c[0])
        return count
    elif p + n // c[0] >= count:
        return n
    elif c[0] < n:
        return min(coin(n - c[0], p + 1, c), coin(n, p, c[1:]))
    else:
        return coin(n, p, c[1:])

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

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

mon.sort(reverse = True)

count = n

print(coin(n, 0, mon))
a = input()
b = input()
print a*b

### FIXED CODE ###

a, b = [int(x) for x in raw_input().split()]
 
print a*b,(a+b)*2
n, k = map(int, input().split())
d = set(map(str, input().split()))
for i in range(n, 10*n):
    if len(d & set(str(i))) == 0:
        print(i)
        break

### FIXED CODE ###

ary = list(map(int, input().split()))
if ary.count(5) == 2 and ary.count(7) == 1:
    print('YES')
else:
    print('NO')
a,b,x=map(int,input().split())
ans=(b//x)-((a-1)//x)
print(ans)

### FIXED CODE ###

s=input()
print("A"+s[8]+"C")
[n,k]=[int(x) for x in onput().split()]
h=[int(x) for x in lnput().split()]
if n<=k:
  print("0")
else:
  print(str(sum(h[k:])))

### FIXED CODE ###

[n,k]=[int(x) for x in input().split()]
h=[int(x) for x in input().split()]
h.sort()
if n<=k:
  print("0")
else:
  print(str(sum(h[:len(h)-k])))
N = int(input())
a = N//4
b = N//7

judge = False
for i in range(a):
  for j in range(b):
    if 4*i+7*k == N:
      judge =True
      break
    if 4*i+7*j > N:
      break
  if judge:
    break

if judge:
  print('Yes')
else:
  print('No')
    
    

### FIXED CODE ###

N = int(input())
a = N//4 +1
b = N//7 +1
     
judge = False
for i in range(a):
  for j in range(b):
    if 4*i+7*j == N:
      judge =True
      break
    if 4*i+7*j > N:
      break
  if judge:
    break
     
if judge:
  print('Yes')
else:
  print('No')
k = input()
s = input()
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)]+'...')

### FIXED CODE ###

a=input()
s = str(a)
if(s[-1] in ('2','4','5','7','9')):
	print('hon')
elif(s[-1] in ('0','1','6','8')):
	print('pon')
elif(s[-1] == '3'):
	print('bon')
a,b,c=[int(x) for x in input()]
print(max(a,b,c)*10+a+b+c-min(a,b,c))

### FIXED CODE ###

a,b,c=[int(x) for x in input().split()]
print(max(a,b,c)*10+a+b+c-max(a,b,c))