Harryxun/stf_run huggingface dataset:
x=int(input())
t=x
c=[]
while x%2==0:
    c.append(2)
    n//=2
f=3
while f*f<=x:
    if x%f==0:
        c.append(f)
    else: f+=2
if x!=1:
    c.append(x)
while i in c:
    for a in range(10*3):
        if i*(a**4+a**3*(a-i)+a**2*(a-i)**2+a*(a-i)**3+(a-i)**4)==t:
            print(a,a-i)
            break
        if -i*(a**4+a**3*(a+i)+a**2*(a+i)**2+a*(a+i)**3+(a+i)**4)==t:
            print(a,a+i)
            break

### FIXED CODE ###

x=int(input())
ma=200
for i in range(ma):
    for j in range(-ma,ma):
        if (i**5 - j**5) ==x:
            print(i,j)
            exit()
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]
ls = list(set(s))
temp=0
for l in ls:
    ans=0
    ans += 1 for ss in s if ss == l
    ans -= 1 for tt in t if tt == l
    temp = ans if ans>temp
print(temp)


### FIXED CODE ###

n=[input() for _ in range(int(input()))]
m=[input() for _ in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i]) for i in range(len(l)))))
H, W = map(int, input().split())
ch, cw = map(int, input().split())
dh, dw = map(int, input().split())
f = [[s=="." for s in input()] for _ in range(H)]

visit = [[-1 for w in range(W)] for h in range(H)]

ch, cw = ch - 1, cw - 1
dh, dw = dh - 1, dw - 1

Q = deque([ch*1000 + cw])
visit[ch][cw] = 0

while len(Q)>0:
  hw = Q.popleft()
  h = hw // 1000
  w = hw % 1000
  for dy in range(-min(2,h), min(3, H-1-h)):
    for dx in range(-min(2,w), min(3, W-1-w)):
      if dx==0 and dy==0:
        continue
      nh = h + dy
      nw = w + dx
      if (dx==0 and abs(dy)==1) or (dy==0 and abs(dx)==1):
        if f[nh][nw]:
          if visit[nh][nw] == -1:
            visit[nh][nw] = visit[h][w]
            Q.appendleft(nh*1000+nw)
          elif visit[nh][nw] > visit[h][w]:
            visit[nh][nw] = visit[h][w]
      else:
        if f[nh][nw]:
          if visit[nh][nw] == -1:
            visit[nh][nw] = visit[h][w] + 1
            Q.append(nh*1000+nw)

print(visit[dh][dw])        



### FIXED CODE ###

H, W = map(int, input().split())
ch, cw =  map(int, input().split())
gh, gw =  map(int, input().split())

f = [[s=="." for s in input()] for h in range(H)]
ans = [[-1 for w in range(W)]for h in range(H)]

nextQ = [(ch-1)*1000 + cw-1]
ans[ch-1][cw-1] = 0
while len(nextQ)>0:
  Q = list(nextQ)
  nextQ = set()
  visited = set()
  while len(Q):
    nh = Q.pop(0)
    nw = nh%1000
    nh = nh//1000
    for dh in range(0-min(nh,2), 3):
      if nh+dh>=H:
        break
      for dw in range(0-min(nw,2), 3):
        if nw + dw>=W:
          break
        if dh==0 and dw==0:
          continue
        if dh*dw==0 and (abs(dh)==1 or abs(dw)==1):
          if ans[nh+dh][nw+dw]==-1:
            if f[nh+dh][nw+dw]:
              Q.append((nh+dh)*1000 + nw+dw)
              visited.add((nh+dh)*1000 + nw+dw)
              ans[nh+dh][nw+dw]=ans[nh][nw]
            else:
              ans[nh+dh][nw+dw]=-2
          elif ans[nh+dh][nw+dw]>ans[nh][nw]:
            Q.append((nh+dh)*1000 + nw+dw)
            visited.add((nh+dh)*1000 + nw+dw)
            ans[nh+dh][nw+dw]=ans[nh][nw]
        else:
          if ans[nh+dh][nw+dw]==-1:
            if f[nh+dh][nw+dw]:
              nextQ.add((nh+dh)*1000 + nw+dw)
              ans[nh+dh][nw+dw]=ans[nh][nw]+1
            else:
              ans[nh+dh][nw+dw]=-2
          elif ans[nh+dh][nw+dw]>ans[nh][nw]:
            nextQ.add((nh+dh)*1000 + nw+dw)
            ans[nh+dh][nw+dw]=ans[nh][nw]+1
  nextQ -= visited
print(ans[gh-1][gw-1])
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(H+1)] for _ in range(W+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()


### FIXED CODE ###

H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()
a,b = map(int,input().split())
a1=str(a)＊b
b1=str(b)＊a

if a>=b:
  print(b1)
elif a<b:
  print(a1)

### FIXED CODE ###

li = input().split()

if li[0]>=li[1]:
  print(li[1] *int(li[0]))
else:
  print(li[0] *int(li[1]))
N = int(input())
D = [int(input()) for i in range(N)]
D = sorted(D)[::-1]

DtoI = {}
pD = [-1] * N
L = [1] * N
T = [0] * N

Y = {}
cnt = 0
for i in range(N):
    DtoI[D[i]] = i

for i in range(N):
    if D[i] in Y:
        for y in Y[D[i]]:
            L[i] += L[y]
            T[i] += T[y] + L[y]
            cnt += 1
        
    p = N - 2 * L[i]
    if p <= 0 or i == N-1:
        pd = -1
    else:
        pd = D[i] - p
    pD[i] = pd
    
    if pd not in Y:
        Y[pd] = []
    Y[pd].append(i)

if pD[-2] < 0:
    print(-1)
else:
    for i in range(N-1):
        print (i + 1, DtoI[pD[i]] + 1)


### FIXED CODE ###

def main():
    N = int(input())
    D = [int(input()) for i in range(N)]
    C = [1] * N
    T = [0] * N
    DI = {}
    for i in range(len(D)):
        DI[D[i]] = i
    D = sorted(D)
    P = [-1] * N
    while len(D) > 1:
        d = D.pop()
        i = DI[d]
        nd = d - N + C[i] * 2
        if nd in DI:
            ni = DI[nd]
        else:
            print(-1)
            return
        P[i] = ni
        C[ni] += C[i]
        T[ni] += T[i] + C[i]
    
    if D[0] == T[DI[D[0]]]:
        for i in range(N):
            if P[i] >= 0: print(i+1, P[i]+1)
    else:
        print(-1)

main()
from collections import deque
N,D,A = [int(i) for i in input().split()]
preXH = [[int(i) for i in input().split()] for j in range(N)]
preXH.sort()
XH = [[x,h//A + bool(h%A)] for x,h in preXH]
Xs = [xxx[0] for xxx in XH]
ans = 0
DP = [0]*N#ダメイジの合計
for n,d in enumerate(DP):
    if d<XH[n][1]:#殺しきれてない
        bonu = XH[n][1]-d
        ans += bonu
        reach = XH[n][0] + 2*D
        for m in range(n,N):
            if XH[m][0] <= reach:
                DP[m] += bonu
            else:breakpoint
print(ans)

### FIXED CODE ###

import sys
fastinput = sys.stdin.readline
N,D,A = [int(i) for i in fastinput().split()]
preXH = [[int(i) for i in fastinput().split()] for j in range(N)]
preXH.sort()
XH = [[x,h//A + bool(h%A)] for x,h in preXH]
X = [x for x,h in XH]+[100000000000000000]
Diff = [X[m+1]-X[m] for m in range(N)]
reach = []
count = 0
l = X[0]
r = X[0]+2*D
for m in range(1,N+1):
    while r<X[m]:#l一個すすめる
        reach.append(m-1)
        r += Diff[count]
        count += 1

damage = 0
ans = 0
DIFF = [0]*N#ダメイジのdiff
for n,d in enumerate(DIFF):
    damage += d
    if damage<XH[n][1]:#殺しきれてない
        bonu = XH[n][1]-damage
        damage += bonu
        ans += bonu
        if reach[n]<N-1:DIFF[reach[n]+1] -= bonu
print(ans)
S, T = input(), input()
ans = len(T)
for i in range(len(S)-len(T)+1):
    tmp = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            tmp += 1
    ans = min(ans, tmp)
print(ans)

### FIXED CODE ###

d, t, s = map(int, input().split())
if s*t >= d:
  print("Yes")
else:
  print("No")
N=int(input())
A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))
print(sume(abs(a-A[N//2]) for a in A))

### FIXED CODE ###

N=int(input())
A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))
print(sum(abs(a-A[N//2]) for a in A))
N, K = map(int, input().split())
Pn = []
for i in range(N):
	Pn.append(input())

Pn.sort()
sum = 0
for i in range(K):
	sum += Pn[K]

print(sum)

### FIXED CODE ###

N, K = map(int, input().split())
P = list(map(int, input().split()))

P.sort()
s = 0
for i in range(K):
	s += P[i]

print(s)
n,k = map(int,input().split())
li = list(map(int, input().split()))
#左から最小値を探していく
#最小値を見つけたら、左側を最小値にしていく
#ないなら(１は１個しかない！！)最小値エリアの右端の値から最小値にしていく

mn = 1#min値を取得
mnix = li.index(1)
mnix0 =mnix #min値の最初のindex
sum = 0 #操作の回数
# li
f=[False]
#左側をまず1へ
while(1):
    if f[0]==True:
        break
    if (mnix+1-k) >0:
        for i in range(mnix+1-k,mnix+1):
            li[i] = mn
        sum +=1
        mnix=li.index(1)
    else:
        for i in range(0,k):
            li[i] = mn
        f[0]=True
        sum +=1

# li
#次に右側を1へ
if (mnix0+1-k) >0:
    #mnix0が右端
    migi = mnix0
if (mnix0+1-k) <=0:
    #k-1が右端
    migi = k-1
# migi

    
f[0]=False
if li[n-1]==1:
    f[0]=True
while(1):
    if f[0]==True:
        break
    if (migi+2)>(n-1):
        for i in range(migi,n):
            li[i] = mn
        sum +=1
        f[0]=True
    else:
        for i in range(migi,migi+k):
            li[i] = mn
        sum +=1
        migi = migi+k-1

 
print(sum)


### FIXED CODE ###

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

min_ind = A.index(1)

print(int((N-1)/(K-1)) if (N-1)%(K-1)==0 else (N-1)//(K-1)+1)
N,X = map(int,input().split())
arr = list(map(int,input().split()))
sumarr = np.cumsum(arr)
print(len(sumarr[sumarr<=X])+1)


### FIXED CODE ###

import numpy as np
N,X = map(int,input().split())
arr = list(map(int,input().split()))
sumarr = np.cumsum(arr)
print(len(sumarr[sumarr<=X])+1)
N, M = map(int, input().split())
for _ in range(M):
    a, b = map(int, input().split())
if M[1]==1:
  print 1
else:
  print 0

### FIXED CODE ###

M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if D2 == 1:
    print(1)
else:
    print(0)
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if ((b-a+1)%2==0 and k>=b-a) or ((b-a+1)%2==1 and k>=b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1),1):
    ans.append(i)
for i in range(b,max(a,b-k),-1):
    ans.append(i)
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)
import numpy as np
N = int(input())
nums = [list(map(int, input().split())) for _ in range(N)]
for row in nums:
  row.append(row[0]+row[1])
  row.append(row[0]-row[1])

nums.sort(key=lambda x: x[2])
ans_1 = N
ans_2 = N

point_1 = nums[0][2]
point_2 = nums[1][2]
for j in range(N-1):
  if nums[j+1][3] < point_1:
    ans_1 -= 1
  else:
    point = nums[j][2]
for j in range(N-1):
  if nums[j+1][3] < point_2:
    ans_2 -= 1
  else:
    point = nums[j][2]
print(max(ans_1, ans_2))

### FIXED CODE ###

N = int(input())
l = []
for i in range(N):
  X, L = map(int, input().split())
  l.append([X-L, X+L])
  
l.sort(key=lambda x: x[1])
pin = l[0][1]
ans = 1

for i in range(1, N):
  if pin <= l[i][0]:
    ans += 1
    pin = l[i][1]
    
print(ans)
N = int(input())
B = map(int, input().split())
A = [B[0]]
for i in range(1, N-1):
    A.append(min(B[i], B[i-1]))
A.append(B[N-2])
print(sum(A))

### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))
A = [B[0]]
for i in range(1, N-1):
    A.append(min(B[i], B[i-1]))
A.append(B[N-2])
print(sum(A))
a, b, c, k = map(int, input().split())

ones = [1] * a
zeros = [0] * b
minus_ones = [-1] * c

ans = sorted(ones + zeros + minus_ones)[-k:]
print(sum(ans))

### FIXED CODE ###

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

if a+b >= k:
    print(min(a, k))
else:
    print(a-k+(a+b))
n, m = map(int, input() .split())

if n >= m//2:
	ans = m//2
else:
	ans = n + (m - 2 * n) // 4

print(ans)

### FIXED CODE ###

N = int(input())

x = N * 800
y = N // 15 * 200

print(x-y)
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
    n -= 1

print(tmp)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
            break
    n -= 1

M = sum(B)
print(M)
C = [str(n+1) for n, v in enumerate(B) if v == 1]
print(' '.join(C))
A = input()
B = input()
B *= 2
if A < B:
    print('0')
else:
    print(A - B)

### FIXED CODE ###

a = list(map(int, input().split()))
A = a[0]
B = a[1]
if A <= B * 2:
    print(0)
else:
    print(A - B * 2)
n = int(input())
if not isinstance(n, int):
    print("No")
else:
    ran = list(range(1,10))
	product = [x*y for x in ran for y in ran]
    print("Yes") if n in product else print("No")

### FIXED CODE ###

n = int(input())
if not isinstance(n, int):
    print("No")
else:
    ran = list(range(1,10))
    product = [x*y for x in ran for y in ran]
    print("Yes") if n in product else print("No")
import sys
input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
mod = 10**9+7

def comb(n, r):
  　if n < r or n < 0 or r < 0: return 0
    if 2*r > n: comb(n, n-r)
    return fac[n] * inv[r] * inv[n-r] % mod

def dfs(v, Pa=-1):
    for u in to[v]:
        if u == Pa: continue
        dfs(u, v)
        size[v] += size[u]
        dp[v] *= dp[u] % mod
        dp[v] *= comb(size[v], size[u]) % mod
    size[v] += 1

def bfs(v, Pa=-1, P_val=1, P_sz=0):
    ans[v] = P_val * dp[v] * comb(n-1, P_sz) % mod
    for u in to[v]:
        if u == Pa: continue
        val = ans[v] * INV(dp[u]*comb(n-1, size[u])) % mod
        bfs(u, v, val, n-size[u])

n = int(input())
to = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(lambda x : int(x)-1, input().split())
    to[a].append(b)
    to[b].append(a)

fac = [1] * (n+2)
inv = [1] * (n+2)

for i in range(2, n+1):
    fac[i] = fac[i-1] * i % mod
INV = lambda x: pow(x, mod-2, mod)
inv[n] = INV(fac[n])
for i in range(n-1, 1, -1):
    inv[i] = inv[i+1] * (i+1) % mod

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

dfs(0)
bfs(0)
print(*ans, sep='\n')

### FIXED CODE ###

import sys

def solve():
    input = lambda: sys.stdin.readline().rstrip()
    sys.setrecursionlimit(10 ** 7)
    mod = 10 ** 9 + 7

    def comb(n, r):
        if r > n: return 0
        return fac[n] * inv[r] * inv[n - r] % mod

    def dfs(v, Pa=-1):
        for u in to[v]:
            if u == Pa: continue
            dfs(u, v)
            size[v] += size[u]
            dp[v] *= dp[u] % mod
            dp[v] *= inv[size[u]] % mod
        dp[v] *= fac[size[v]] % mod
        size[v] += 1

    def bfs(v, Pa=-1, P_val=1, P_sz=0):
        ans[v] = P_val * dp[v] * comb(n - 1, P_sz) % mod
        for u in to[v]:
            if u == Pa: continue
            val = ans[v] * INV(dp[u] * comb(n - 1, size[u])) % mod
            bfs(u, v, val, n - size[u])

    n = int(input())
    to = [[] for _ in range(n)]
    for _ in range(n - 1):
        a, b = map(lambda x: int(x) - 1, input().split())
        to[a].append(b)
        to[b].append(a)

    fac = [1] * (n + 2)
    inv = [1] * (n + 2)

    for i in range(2, n + 1):
        fac[i] = fac[i - 1] * i % mod
    INV = lambda x: pow(x, mod - 2, mod)
    inv[n] = INV(fac[n])
    for i in range(n - 1, 1, -1):
        inv[i] = inv[i + 1] * (i + 1) % mod

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

    dfs(0)
    bfs(0)
    print(*ans, sep='\n')

if __name__ == '__main__':
    solve()
import iterools

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

for i in range(n+1):
  if i == len(n):
    print(1)
  else:
    combos = list(itertools.combinations(a, i))
    print(len(set(combos)))


### FIXED CODE ###

import itertools

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

MOD = 10**9 + 7
MAX_NUM = 10**5 + 10

def inv_mod(n):
  return pow(n, MOD-2, MOD)

FACTS = [1 for _ in range(MAX_NUM+1)]
for n in range(1, MAX_NUM+1):
  FACTS[n] = (n*FACTS[n-1]) % MOD

INV_FACTS = [1 for _ in range(MAX_NUM+1)]
INV_FACTS[MAX_NUM] = inv_mod(FACTS[MAX_NUM])
for n in range(MAX_NUM-1, -1, -1):
  INV_FACTS[n] = (INV_FACTS[n+1]*(n+1)) % MOD
  
for i in range(MAX_NUM+1):
  assert (FACTS[i]*INV_FACTS[i])%MOD == 1

def ncr(n, r):
  if r > n:
    return 0
  if r < 0:
    return 0
  # C(n, r) = n!/(n-r)!r!
  ans = FACTS[n]*INV_FACTS[n-r]*INV_FACTS[r]
  return ans % MOD

from collections import defaultdict
v2i = defaultdict(list)
for i, v in enumerate(A):
  v2i[v].append(i)

fst, snd = -1, -1
for v in v2i:
  if len(v2i[v]) == 2:
    fst, snd = v2i[v]

K = snd - fst - 1
for ell in range(1, N+2):
  ans = ncr(N+1, ell) - ncr(N-1-K, ell-1)
  print(ans%MOD)
import math,copy

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

# 1つの数値を順に取り除いて、残りの最大公約数を求める
gcd_list = []

for i in range(N):
    A_rest = A.copy()
    A_rest.remove(A_rest[i])
    pre = A_rest[0]
    for j in range(1,N-1):
        gcd_tmp = math.gcd(pre,A_rest[j])
        pre = gcd_tmp
    gcd_list.append(pre)

print(max(gcd_list))

### FIXED CODE ###

import copy

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

def gcd(x,y):
    while y != 0:
        x,y = y,x%y
    return x

# 1つの数値を順に取り除いて、残りの最大公約数を求める
l_gcd_list = [A[0]]
r_gcd_list = [A[-1]]
gcd_list = []

# 左右端を抜く場合は後で計算
for i in range(1,N-1):
    l_gcd_list.append(gcd(l_gcd_list[-1], A[i]))
    r_gcd_list.append(gcd(r_gcd_list[-1], A[-i-1]))

# 左右端以外のi番目の数値を抜いた場合
for i in range(1,N-1):
    gcd_list.append(gcd(l_gcd_list[i-1],r_gcd_list[-i-1]))

# 左右どちらかの端の数値を抜いたとき
gcd_list.append(l_gcd_list[-1])
gcd_list.append(r_gcd_list[-1])
    
print(max(gcd_list))
N = set(input())
A = set('1974')
print('YES if N==A else 'NO')

### FIXED CODE ###

N = set(input().split())
A = set('1 9 7 4'.split())
print('YES' if N==A else 'NO')
def main():
    while True:
        input_line = raw_input()
        num1 = int(input_line.split(' ')[0])
        num2 = int(input_line.split(' ')[1])
        
        sum = str(num1 + num2)
        
        count = 0
        for num in sum:
            count += 1
        else:
            print(count)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

def main():
    for input_line in sys.stdin:
        num1 = int(input_line.split(' ')[0])
        num2 = int(input_line.split(' ')[1])
        
        sum = str(num1 + num2)
        
        count = 0
        for num in sum:
            count += 1
        else:
            print(count)
    
if __name__ == '__main__':
    main()
N,K = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*N
ans = int(0)
for i in range(K):
    dp[i+1] = abs(h[i+1]-h[0])

for i in range(2,N):
    if i<K:
        c = i
    else:
        c = K
    dpcandi = [0] * c
    for j in range(c):
        dpcandi[j] = dp[i-j-1] + abs(h[i]-h[i-j-1])
    dp[i] = min(dpcandi)

ans = dp[N-1]

print(ans)

### FIXED CODE ###

N,K = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*N
ans = int(0)
c = int(0)
if N < K:
    c = N-1
else:
    c = K
for i in range(c):
    dp[i+1] = abs(h[i+1]-h[0])

for i in range(2,N):
    if i<K:
        c = i
    else:
        c = K
    dpcandi = [0] * c
    for j in range(c):
        dpcandi[j] = dp[i-j-1] + abs(h[i]-h[i-j-1])
    dp[i] = min(dpcandi)

ans = dp[N-1]

print(ans)
num = [int(i) for i in input().split()]
num = num.sorted(reverse=True)
ans = 10*num[0] + num[1] + num[2]
print(ans)

### FIXED CODE ###

num = [int(i) for i in input().split()]
num.sort()
print(sum(num)+num[-1]*9)
n=int(input())
a=sorted(list(map(int,input().split())))
i=0
while(a[-2] != 0):
    if(a[-1]%a[i]==0):
        a[-1]=0
        i+=1
    else:
        a[-1]=a[-1]-(a[-1]//a[i])*a[i]
    a=sorted(a)
print(a[-1])

### FIXED CODE ###

a,b=map(int,input().split())
if(b%a==0):
    print(a+b)
else:
    print(b-a)
#!/usr/bin/env python
import re

s = input()
STR = 'AKIHABARA'
if len(s) > len(STR):
    print('NO')
    exit()

regex = re.compile('A?KIHA?BA?RA?')
mo = regex.search(s)
if mo == None:
    print('NO')
else:
    print('YES')
~                 

### FIXED CODE ###

#!/usr/bin/env python
import re

s = input()
STR = 'AKIHABARA'
if len(s) > len(STR):
    print('NO')
    exit()

regex = re.compile('^A?KIHA?BA?RA?')
mo = regex.search(s)
if mo == None:
    print('NO')
else:
    print('YES')
h, w, a, b = map( int, input().split() )

SIZE = h+w+2
MOD = 10**9 + 7
MOD_Farmer = 10**9+5

fact = [0] * SIZE
inv = [0] * SIZE
fact_inv = [0] * SIZE

# prepare --------------------------------
inv[0] = 0
inv[1] = 1
fact[0] = fact[1] = 1
fact_inv[0] = fact_inv[1] = 1
for i in range( 2, SIZE ):
  fact[i] = fact[i-1] * i % MOD
  fact_inv[i] = fact[i] **( 10**4 ) \
              * fact[i] **( 10**5 ) \
              * fact[i] ** 5 % MOD % MOD
# ----------------------------------------
def comb( n, r ):
  if r >= 0 and n >= 0:
    return fact[n] * fact_inv[n-r] * fact_inv[r]
  else :
    return 0.0
# ----------------------------------------

ans = 0
for i in range( h-a ):
    ans += comb(i+b-1, b-1) * comb(h-i-1+w-b-1,w-b-1)
    ans %= MOD
print( ans )

### FIXED CODE ###


a, b, c = map( int, input().split() )
 
if a == 5 and b == 5 and c == 7:
	print( "YES" )
elif a == 5 and b == 7 and c == 5:
  	print( "YES" )
elif a == 7 and b == 5 and c == 5:
  	print( "YES" )
else :
	print( "NO" )
# E - Colorful Blocks
import sys
sys.setrecursionlimit(10**8)

MOD = 998244353
N,M,K = map(int,input().split())
inv_M = pow(M-1,-1,MOD)
ans = 0
tmp = pow(M-1,N-1,MOD)
comb = 1
for i in range(K+1):
    ans = (ans+M*comb*tmp)%MOD
    if i==K:
        break
    tmp = (tmp*inv_M)%MOD
    comb = (comb*(N-1-i)*pow(i+1,-1,MOD))%MOD
print(ans)

### FIXED CODE ###

# E - Colorful Blocks
import sys
sys.setrecursionlimit(10**8)

MOD = 998244353
N,M,K = map(int,input().split())
inv_M = pow(M-1,-1,MOD) if M>1 else 0
ans = 0
tmp = pow(M-1,N-1,MOD) if M>1 else 0
comb = 1
for i in range(K+1):
    ans = (ans+M*comb*tmp)%MOD
    if i==K:
        break
    tmp = (tmp*inv_M)%MOD
    comb = (comb*(N-1-i)*pow(i+1,-1,MOD))%MOD
if M==1 and K==N-1:
    ans += 1
print(ans)
N, M = map(int, input().split(" "))
G = [[] for _ in range(N)]
 
for _ in range(M):
    x, y = map(int, input().split(" "))
    G[x-1].append(y-1)
dp = [-1] * N
def pathlen(G, dp, v):
    if dp[v] != -1:
        return dp[v]
 
    plen = 0
    for i in G[v]:
        plen = max(plen, pathlen(G, dp, i)+1)
    dp[v] = plen
    return plen
ans = 0
for i in range(N):
    ans = max(ans, pathlen(G, dp, i))
print(ans)

### FIXED CODE ###

import sys
 
sys.setrecursionlimit(100000)
 
N, M = map(int, input().split(" "))
G = [[] for _ in range(N)]
 
for _ in range(M):
    x, y = map(int, input().split(" "))
    G[x-1].append(y-1)
dp = [-1] * N
def pathlen(G, dp, v):
    if dp[v] != -1:
        return dp[v]
 
    plen = 0
    for i in G[v]:
        plen = max(plen, pathlen(G, dp, i)+1)
    dp[v] = plen
    return plen
ans = 0
for i in range(N):
    ans = max(ans, pathlen(G, dp, i))
print(ans)
#解答
w, h, x, y = list(map(int, input().split()))
ans = 0
 
if ((x, y) == (w / 2, h / 2)):
    print("{s} {mul}".format(s=(w * h / 2), mul=1))
else:
    print("{s} {mul}".format(s=(w * h / 2), mul=0))
w, h, x, y = list(map(int, input().split()))
ans = 0

if ((x, y) == (w / 2, h / 2)):
    print("{s} {mul}".format(s=(w * h / 2), mul=1))
else:
    print("{s} {mul}".format(s=(w * h / 2), mul=0))

### FIXED CODE ###

#解答
w, h, x, y = list(map(int, input().split()))
ans = 0
 
if ((x, y) == (w / 2, h / 2)):
    print("{s} {mul}".format(s=(w * h / 2), mul=1))
else:
    print("{s} {mul}".format(s=(w * h / 2), mul=0))
N=int(input())
P=list(map(int,input().split()))

ct=1
for i in range(round(N/2)+1):
	for j in range(i+1):
		if P[i-j]<=P[i+1]:
			break
		elif j==i:
			ct+=1
for i in range(round(N/2)-1,N):
	temp=0
	for j in range(N-i):
		if P[i]>=P[i+j]:
			temp+=1
	if temp==P[i]-1:
		ct+=1
			

print(ct)

### FIXED CODE ###

import numpy as np
N=int(input())
P=list(map(int,input().split()))

ct=0
min_p=P[0]
for i in range(N):
	if P[i]<=min_p:
		min_p=P[i]
		ct+=1


print(ct)
n=int(input())
print (3*n*N)

### FIXED CODE ###

n=int(input())
print (3*n*n)