Harryxun/stf_run huggingface dataset:
from itertools import combinations
import numpy as np

def saiki(now, reachable):
#     print(now)
    cue = []
    cand = dic[now]
    while len(cand) > 0:
        c = cand[0]
        cand.pop(0)
        if c in reachable:
            pass
        else:
            reachable += [c]
            cand += saiki(c, reachable)
            
    return reachable

n,m = list(map(int, input().split()))
a = []
b = []
for _ in range(m):
    aa, bb = list(map(int, input().split()))
    a.append(aa)
    b.append(bb)

for k_start in range(1, m + 1):
    dic = {}
    for k in range(1, n+1):
        dic[k] = []
    for k in range(k_start, m):
        dic[a[k]] += [b[k]]
        dic[b[k]] += [a[k]]

    nodes = list(range(1,n+1))

    rs = []
    while len(nodes) > 0:
        reachable = [nodes[0]]
        reachable = saiki(nodes[0], reachable)
        for r in reachable:
            nodes.remove(r)
        rs.append(len(reachable))
#     print(rs)
    s = 0
    for c in combinations(rs, 2):
        s += c[0] * c[1]
    print(s)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
 
N, M = map(int, input().split())
X = []
for _ in range(M):
    a, b = map(int, input().split())
    X.append((a-1, b-1))
X = X[::-1]
    
P = [-1] * N
CT = [1] * N
def pr(i):
    if P[i] < 0:
        return i
    t = pr(P[i])
    P[i] = t
    return t
 
ANS = [0] * M
ans = N * (N-1) // 2
ANS[-1] = ans
for m in range(M-1):
    a, b = X[m]
    pa = pr(a)
    pb = pr(b)
    
    if pa != pb:
        ans -= CT[pa] * CT[pb]
        P[pa] = pb
        CT[pb] += CT[pa]
 
    ANS[-m-2] = ans
 
for a in ANS:
    print(a)
while True:
    e = int(raw_input())
 
    if e == 0:
        break

    ans = 1e8

    for z in range(10**2+1):
        for y in range(10**3+1):
            if y**2 + z**3 <= e:
                x = e - y**2 - z**3
                ans = min(ans, x+y+z)

    print ans



### FIXED CODE ###

#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)
import numpy as np

n = int(input())

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

y = np.zeros((n, 1), dtype=np.int)

for i, wa in enumerate(a):
    y[i][0] = wa

A = np.zeros((n, n), dtype=np.int)

for i in range(n-1):
    A[i][i] = 1
    A[i][i+1] = 1

A[n-1][n-1] = 1
A[n-1][0] = 1

exit()



### FIXED CODE ###

import numpy as np
import sys

n = int(input())

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

a_sum = sum(a)
# x[i]はi番目のダムに溜まった水の半分
x = []

x_0 = int(a_sum/2)

for i in range(int((n-1)/2)):
    x_0 -= a[2*i+1]

x.append(x_0)
x_tmp = x_0

for i in range(n-1):
    x_tmp = a[i] - x_tmp
    x.append(x_tmp)

for wa in x:
    print(wa*2, end=' ')
S = int(input())
h = S//3600
m = S%3600//60
s = S%60
print(f"h":"m":"s")



### FIXED CODE ###

S = int(input())
h = S//3600
m = S%3600//60
s = S%60
print(f"{h}:{m}:{s}")
x,y,z,k = [int(i) for i in 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 a:
  for j in b:
    for k in c:
      sum.append(i+j+k)
      
sum.sort(reverse=True)

for i in range(k):
  print(sum[i])

### FIXED CODE ###

x,y,z,k = [int(i) for i in 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)

d = []
for i in a:
  for j in b:
    d.append(i+j)
d.sort(reverse = True)
d = d[:k]

e = []
for i in c:
  for j in d:
    e.append(i+j)
e.sort(reverse = True)

e = e[:k]

for i in e:
  print(i)
n = int(input())
S = input()
cnt = 0
for i in range(1000):
  hy = i//100
  zyu = (i-hy*100)//10
  ichi = i%10
  cnt_hy = float('inf')
  cnt_zyu = float('inf')
  cnt_ichi = float('inf')
  t = 0
  for j in range(n):
    if int(S[j]) == hy and t == 0:
      cnt_hy = j
      t += 1
    elif int(S[j]) == zyu and t == 1:
      cnt_zyu = j
      t += 1
    elif int(S[j]) == ichi and t == 2:
      cnt_ichi = j
  if cnt_hy < cnt_zyu < cnt_ichi <= n-1:
    cnt += 1
print(cnt)

### FIXED CODE ###

a,b = map(int,input().split())
c,d = map(int,input().split())
if a != c:
  print('1')
else:
  print('0')
N=int(input())
ans=[]
for i in range(1,N//2):
    if N%i==0:
        ans.append(N//i+i-2)
print(min(ans))

### FIXED CODE ###

N=int(input())
ans=[]
for i in range(1,int(N**.5)+2):
    if N%i<1:
        ans.append(N//i+i-2)
print(min(ans))
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    def popcount(n):
        return bin(n).count("1")

    n = int(input())
    X = input()
    cnt_init = X.count("1")

    for j in range(n):
        if X[j] == "0":
            cnt = cnt_init + 1
            x = int(X, 2) + pow(2, n - j - 1, cnt)
        else:
            cnt = cnt_init - 1
            x = int(X, 2) - pow(2, n - j - 1, cnt)

        res = 0
        while x:
            if res != 0:
                cnt = popcount(x)
            x %= cnt
            res += 1
        print(res)


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    X = input()
    cnt_init = X.count("1")
    x = int(X, 2)
    a = x % (cnt_init + 1)
    if cnt_init - 1 != 0:
        b = x % (cnt_init - 1)

    for i in range(n):
        if X[i] == "0":
            cnt = cnt_init + 1
            y = (a + pow(2, n - i - 1, cnt)) % cnt
        else:
            cnt = cnt_init - 1
            if cnt == 0:
                print(0)
                continue
            y = (b - pow(2, n - i - 1, cnt)) % cnt

        res = 1
        while y:
            cnt = bin(y).count("1")
            y %= cnt
            res += 1
        print(res)


if __name__ == '__main__':
    resolve()
N = input()
print(N+1//2)

### FIXED CODE ###

N = int(input())
print((N+1)//2)
import math

a, b = map(int, input().split())
print(int(a * b / math.gcd(a, b)))

### FIXED CODE ###

import fractions

a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
def input():
    return sys.stdin.readline().strip()


def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [0] * n
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])

    for i in range(2, n):
        dp[i] = min(abs(h[i] - h[j]) + dp[j] for j in range(max(0, i - k), i))
    print(dp[n - 1])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


def input():
    return sys.stdin.readline().strip()


def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [0] * n
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])

    for i in range(2, n):
        dp[i] = min(abs(h[i] - h[j]) + dp[j] for j in range(max(0, i - k), i))
    print(dp[n - 1])


if __name__ == "__main__":
    main()
D,N=map(int,input().split())
if N==100:
  print((N+1)*(100**D)
else:
  print(N*(100**D)


### FIXED CODE ###

D,N=map(int,input().split())
if N==100:
  print((N+1)*(100**D))
else:
  print(N*(100**D))
n = int(input())
xyh = [tuple(map(int,input().split())) for i in range(n)]

for cx in range(101):
    for cy in range(101):
        ch = None
        okflag = True
        for x,y,h in xyh:
            if h == 0 or okflag == False:
                continue
            if ch == None:
                ch = h + abs(x-cx) + abs(y-cy)
                continue

            if ch != h + abs(x-cx) + abs(y-cy):
                    okflag = False
                    break

        if okflag == True:
            xyh_c = (cx, cy, ch)
            candidates.append(xyh_c)

okflag = True
for xyh_c in candidates:
    cx, cy, ch = xyh_c
    for x,y,h in xyh:
        if h != max(ch - abs(x-cx) - abs(y-cy) ,0):
            okflag = False
            break

    if okflag == True:
        print(cx, cy, ch)
        exit()



### FIXED CODE ###

n = int(input())
xyh = [tuple(map(int,input().split())) for i in range(n)]

candidates =[]

for cx in range(101):
    for cy in range(101):
        ch = None
        for x,y,h in xyh:
            if h == 0:

                continue
            if ch == None:
                ch = h + abs(x-cx) + abs(y-cy)
                continue

            if ch != h + abs(x-cx) + abs(y-cy):
                break

        else:
            xyh_c = (cx, cy, ch)
            candidates.append(xyh_c)

for xyh_c in candidates:
    cx, cy, ch = xyh_c
    for x,y,h in xyh:
        if h != max(ch - abs(x-cx) - abs(y-cy) ,0):
            break
    else:
        print(cx, cy, ch)
        exit()
n = int(input())
a = list(map(int,input().split()))

for i in a:
    if i > 2 * (10 ** 5):
        a.pop(i)

ans = 0
for j in range(len(a)):
    for k in range(j+1, len(a)):
        #print(j,k)
        if  a[j] + a[k] == abs(j - k):
           #print(j,k, a[j],a[k])
           ans = ans + 1

print(ans)

### FIXED CODE ###

n = int(input())

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

c = {}
for i in range(n):
    if a[i] + i + 1 not in c.keys():
        c[a[i]+i+1] = 1
    else:
        c[a[i]+i+1] += 1

#print(c)

ans = 0
for i in range(n):
    if i + 1 - a[i] not in c.keys():
        pass
    else:
        ans += c[i + 1 - a[i]]

print(ans)
# coding: utf-8
import time
import re
import math
import fractions

def main():
    lst=[int(input()) for a in range(5)]
    index=0
    mn=1e9
    for a in range(len(lst)):
        if lst[a]<mn:
            mn=lst[a]
            index=a
    print(sum(list(map(lambda x:math.ceil(x/10)*10,lst))-(10-mn%10)))

    
    
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())
# global n,A,s,memo,mx,mn,L,B



### FIXED CODE ###

# coding: utf-8
import time
import re
import math
import fractions

def main():
    lst=[int(input()) for a in range(5)]
    index=0
    mx=0
    total=0
    for a in range(len(lst)):
        if math.ceil(lst[a]/10)*10-lst[a]>mx:
            mx=math.ceil(lst[a]/10)*10-lst[a]
            index=a
    #print(index)
    for a in range(len(lst)):
        if a==index:
            total+=lst[a]
        else:
            total+=math.ceil(lst[a]/10)*10
    print(total)
    
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())
# global n,A,s,memo,mx,mn,L,B
a,b,c=(map(int,input().split()))
print((a+c==2*b?Yes:No))


### FIXED CODE ###

a,b,c=map(int,input().split())
if a+c==2*b:
  print("YES")
else:
  print("NO")
N = int(input())
A = list(map(int, input().split())
B = []  # 累積和テーブル B[i] = sum(A[:i])
mod = 10**9 + 7
ans = 0

for i in range(N+1):
    B.append(sum(A[:i]))  # 累積和

for i in range(N):
    sum = (B[N] - B[i+1]) % mod
    ans += A[i] * sum
    ans %= mod

print(ans)

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
B = [0] * (N+1)  # 累積和テーブル B[i] = sum(A[:i])
mod = 10**9 + 7
ans = 0

for i in range(N):
    B[i+1] = B[i] + A[i]  # 累積和

for i in range(N):
    sum = (B[N] - B[i+1]) % mod
    ans += A[i] * sum
    ans %= mod

print(int(ans))
N,W=map(int,input().split())
A = [list(map(int, input().split())) for i in range(N)]



dp=np.zeros((N+1,W+1))


for i in range(N):
    for w in range(W+1):
        if w>=A[i][0]:
            dp[i+1][w] = max([dp[i][w-A[i][0]]+A[i][1], dp[i][w]])
        else:
            dp[i+1][w] = dp[i][w]
        
print(int(dp[N][W]))

### FIXED CODE ###

N,W=map(int,input().split())
A = [list(map(int, input().split())) for i in range(N)]



dp = [[0 for i in range(W+1)] for j in range(N+1)]


for i in range(N):
    for w in range(W+1):
        if w>=A[i][0]:
            dp[i+1][w] = max([dp[i][w-A[i][0]]+A[i][1], dp[i][w]])
        else:
            dp[i+1][w] = dp[i][w]
        
print(int(dp[N][W]))
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

if __name__=='__main__':
    mod = 1000000007
    n = I()
    a = LI()
    a.sort(reverse=True)
    ans = 0
    dig = int(math.log2(a[0])) + 1
    for i in range(dig):
        c0 = 0
        c1 = 0
        for rep in a:
            if (rep>>i)&1:
                c1 += 1
            else:
                c0 += 1
        ans += (c0*c1*2**i)%mod
    	ans %= mod
    print(ans)

### FIXED CODE ###

from sys import stdin
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

if __name__=='__main__':
    mod = 10**9 + 7
    n = I()
    a = LI()
    ans = 0
    for i in range(60):
        c1 = 0
        for rep in a:
            if (rep>>i)&1:
                c1 += 1
        ans += ((n-c1)*c1*(2**i)%mod)%mod
    print(ans%mod)
n = input()
print(max((len(n)-1)*9 + int(n[0])-1, sum(n)))

### FIXED CODE ###

ns = list(map(int, list(input())))
print(max(sum(ns), ns[0]-1 + 9*(len(ns)-1)))
H, N = input().split()
A = input().split()

if int(H)-sum(A) <=0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if int(H)-sum(A) <=0:
    print("Yes")
else:
    print("No")
W,H,x,y,r = map(int,input().split())

if W > r + x and H > r + y and x => r and y => r  :
    print('Yes')
else:
    print('No')


### FIXED CODE ###

W,H,x,y,r = map(int,input().split())

if x-r < 0:
    print("No")
elif x + r > W:
    print("No")
elif y-r < 0:
    print ("No")
elif y+r > H:
    print("No")
else:
    print("Yes")
n,k =map(int,input().split())
a=list(map(int,input().split()))
a = [1] + a
def next(i):
    return a[i]

z = [0] * (n+1)

place = 1
T = 0
interval = 0
if k < n:
    for i in range(k):
        place = next(place)
    print(place);exit()
place = 0
for i in range(n):
    place = next(place)
    if z[place] != 0:
        interval = T - z[place]
        break
    z[place] = T
    T += 1
m = (k-z[place])%interval
for i in range(m):
    place = next(place)
print(place)


### FIXED CODE ###

n,k =map(int,input().split())
a=list(map(int,input().split()))
a = [1] + a
def next(i):
    return a[i]

z = [0] * (n+1)

place = 1
T = 0
interval = 0
if k < n:
    for i in range(k):
        place = next(place)
    print(place);exit()
place = 0
k += 1
for i in range(n):
    place = next(place)
    if z[place] != 0:
        interval = T - z[place]  + 1
        break
    z[1] = 1 
    T += 1
    z[place] = T

m = (k-z[place])%interval
for i in range(m):
    place = next(place)
print(place)
N=int(input())
if N==1:
    print('Hello World')
else:
    A,B=map(int,input().split())
    print(A+B)

### FIXED CODE ###

N=int(input())
if N==1:
    print('Hello World')
else:
    A=int(input())
    B=int(input())
    print(A+B)
import numpy as np
ans = 0
r,g,b,n = map(int,input().split())
for i in range(n//r+1):
	targ = i*r
	for j in range(n//g+1):
		if (n-i*r-j*g) % b == 0 and (n-i*r-j*g) >= 0:
			ans += 1
print(ans)

### FIXED CODE ###

ans = 0
r,g,b,n = map(int,input().split())
for i in range(n//r+1):
	targ = i*r
	for j in range(n//g+1):
		if (n-i*r-j*g) % b == 0 and (n-i*r-j*g) >= 0:
			ans += 1
print(ans)
import numpy as np
N, T = [int(a) for a in input().split()]
time = np.full(N + 1, -1, dtype = np.int32)
value = np.full(N + 1, -1, dtype = np.int32)
for i in range(1, N + 1):
    time[i], value[i] = [int(a) for a in input().split()]

# Sort the array in the increasing order of value
time = time[np.argsort(value)]
value.sort()

# table for knapsack problem
# maximum possible time is T-1
dp_table = np.full((N + 1, T + 1), -1, dtype = np.int32)

def knapsack(n, t):
    '''
    Input: n ... the number of elements to choose from
                 n means items 1, 2, ..., n can be chosen
           t ... time limit
    Output: total value
    '''
    if n <= 0 or t <= 0:
        return 0
    elif dp_table[n, t] >= 0:
        return dp_table[n, t]
    elif time[n] > t:
        ans = knapsack(n-1, t)
    else:
        ans = max(knapsack(n-1, t), value[n] + knapsack(n-1, t - time[n]))

    dp_table[n, t] = ans
    return ans

def all_you_can_eat(n, t):
    if n <= 0 or t <= 0:
        return 0
    else:
        # Eat the most delicious food at the beginning
        tmp1 = value[n] + all_you_can_eat(n - 1, t - time[n])
        # Eat the most delicious food at the end
        tmp2 = value[n] + knapsack(n - 1, t - 1)
        return max(tmp1, tmp2)

print(all_you_can_eat(N, T))


### FIXED CODE ###

import sys
from operator import itemgetter

sys.setrecursionlimit(5000)
input = sys.stdin.readline


TIME = 0
VAL = 1

N, T = [int(a) for a in input().split()]
time_value = [None] * (N + 1)
time_value[0] = (-1, -1)
for i in range(1, N + 1):
    time_value[i] = tuple(int(a) for a in input().split())

# Sort the array in the increasing order of value
time_value.sort(key = itemgetter(VAL))


# T by (N + 1) table for knapsack problem
# maximum possible time is T-1
dp_table = [[-1] * T for _ in range(N + 1)]

# Fill in dp_table i.e. solve knapsack problem
for t in range(0, T):
    dp_table[0][t] = 0

for n in range(1, N + 1):
    dp_table[n][0] = 0
    for t in range(1, T):
        if time_value[n][TIME] > t:
            dp_table[n][t] = dp_table[n - 1][t]
        else:
            dp_table[n][t] = max(dp_table[n - 1][t],
                             time_value[n][VAL] + dp_table[n - 1][t - time_value[n][TIME]])


val_acum = time_value[N][VAL]
t = T - 1
max_val = val_acum + dp_table[N - 1][t]

for n in range(N - 1, 0, -1):  # food to eat at the end
    val_acum += time_value[n][VAL] # value[N] + value[N-1] + ... + value[n]
    t -= time_value[n + 1][TIME] # T - 1 - (time[N] + time[N-1] + ... + time[n + 1])
    if t < 0: break
    tmp = val_acum + dp_table[n - 1][t]
    max_val = max(max_val, tmp)

print(max_val)
A,B,C,K = map(int, input().split())
card_list = [1]*A + [0]*B + [-1]*C
 
print(sum(card_list[0:K]))

### FIXED CODE ###

A,B,C,K = map(int, input().split())
ans = 0
if K <= A:
  ans = K
else:
  if K > A and K <= A+B:
    ans = A
  else:
    ans = A-(K-A-B)
print(ans)
a,b = input().split()
if (a*b % 2 == 1):
    print("0dd")
else:
    print("Even")

### FIXED CODE ###

(a,b)=map(int,input().split())
if a*b%2==0:
  print("Even")
else:
  print("Odd")
import math
N,M=map(int,input().split())
def kumiawase(n):
    a=math.factorial(n)
    r=math.factorial(2)
    return a / (r*math.factorial(n-2))
print(int(kumiawase(M)+kumiawase(N)))

### FIXED CODE ###

N,M=map(int,input().split())
print(int(N*(N-1)/2+M*(M-1)/2))
n,m=map(int, input().split())  #複数数値入力

if m == 0:
    print(countWays_memo(n))
else:
    list_a = []
    for i in range(m):
        list_a.append(int(input()))

    def countWays_memo(n):
        memo = [-1]*(n+1)
        def _countWays(n):
            if n < 0:
                return 0
            elif n == 0:
                return 1
            else:
                if memo[n] > -1:
                    return memo[n]
                else:
                    memo[n] = _countWays(n-1) + _countWays(n-2) 
                    return memo[n]
        return _countWays(n)

    steps = [list_a[0]]
    now_step=list_a[0]+1
    for i in range(len(list_a)-1):
        steps.append(list_a[i+1]-now_step)
        now_step = list_a[i+1]+1
    steps.append(n-now_step+1)


    dict_steps = {}
    for s in set(steps):
        dict_steps[s] = steps.count(s)

    ans = 1
    for k,v in dict_steps.items():
        ans *= countWays_memo(k-1)**v

    print(ans% 1000000007)

### FIXED CODE ###

n,m=map(int, input().split())  #複数数値入力

import sys

sys.setrecursionlimit(10**9)

def countWays_memo(n):
    memo = [-1]*(n+1)
    def _countWays(n):
        if n < 0:
            return 0
        elif n == 0:
            return 1
        else:
            if memo[n] > -1:
                return memo[n]
            else:
                memo[n] = _countWays(n-1) + _countWays(n-2) 
                return memo[n]
    return _countWays(n)
    
if m == 0:
    print(countWays_memo(n)% 1000000007)
else:
    list_a = []
    for i in range(m):
        list_a.append(int(input()))

    steps = [list_a[0]]
    now_step=list_a[0]+1
    for i in range(len(list_a)-1):
        steps.append(list_a[i+1]-now_step)
        now_step = list_a[i+1]+1
    steps.append(n-now_step+1)


    dict_steps = {}
    for s in set(steps):
        dict_steps[s] = steps.count(s)

    ans = 1
    for k,v in dict_steps.items():
        ans *= countWays_memo(k-1)**v

    print(ans% 1000000007)
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
temp=a[0]+a[n-1]
for i in range(1,n):
  temp=max(temp,a[i]-i[i-1])
print(k-temp)

### FIXED CODE ###

k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
temp=a[0]+k-a[n-1]
for i in range(1,n):
  temp=max(temp,a[i]-a[i-1])
print(k-temp)
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
M=0
for i in range(N):
    A[i]-=1
for i in range(N-1):
    if A[i]+1==A[i+1]:
        M+=B[A[i]]+C[A[i]]
    else:
        M+=B[A[i]]
print(M+B[A[N-1]])

### FIXED CODE ###

N=int(input())
print(N*N*N)
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n = i_input()
    
    str_n = str(n)

    for i in range(3):
        if str_n[i] == '1':
            print(9,end='')
        else:
            print(1,end='')
        
    print()

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n = i_input()
    
    str_n = str(n)

    for i in range(3):
        if str_n[i] == '1':
            print(9,end='')
        else:
            print(1,end='')
        
    print()

if __name__ == '__main__':
    main()
n,t = map(int,input().split())

a = []

for i in range(n):
    a.append(list(map(int,input().split())))

min = 9999

for i in a:
    if i[1] <= t and i[0] < min:
        min = i[0]

if min > 1000:
    print("TLE")
else:
    print(min)


### FIXED CODE ###

n = int(input())
if n ==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)