peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from collections import deque

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

grid = [[] for _ in range(n + 1)]

ans = [0] * n
visited = [False] * n
visited[0] = True

for _ in range(m):
  s, t = map(int, input().split())
  grid[s].append(t)
  grid[t].append(s)

queue = deque([1])

while queue:
  node = queue.popleft()
  for i in grid[node]:
    if visited[i - 1]:
      continue
    visited[i - 1] = True
    ans[i - 1] = node
    queue.append(i)

print('Yes')
for i in ans[1:]:
  print(i)
# Judge status: Accepted
#!/usr/bin/env python3
N = int(input())
A = list(map(int, input().split()))

mod = 10 ** 9 + 7

s = sum(A)** 2

a = 0
for i in A:
    a += (i ** 2)

ans = (s - a) // 2
ans = ans % mod

print(ans)
# Judge status: Wrong Answer
x = input()

if x == 0:
  x = 1

if x == 1:
  x = 0
 
print(x)
# Judge status: Accepted
N, C, K = map(int, input().split())
T = [int(input()) for _ in range(N)]
T.sort()
s = 0
ans = 0
for i in range(N):
    if i - s + 1 > C or T[i] - T[s] > K:
        s = i
        ans += 1
print(ans+1)
# Judge status: Wrong Answer
a,b=map(int,input().split())
s=0.111111111
if a<b:
  print(a*int(s*(10**(b-1))))
else:
  print(b*int(s*(10**(a-1))))
# Judge status: Accepted
a,b=map(int,input().split())
count=0
for d in range(a,b+1):
    l=list(str(d))
    if l[0]==l[-1] and l[1]==l[-2]:
        count+=1
print(count)
# Judge status: Wrong Answer
n, k = map(int,input().split())
a = list(map(int,input().split()))
a = list(set(a))
if len(a) > k:
    print(len(a) - k)
else:
    print(0)
# Judge status: Accepted
import math
a,b,c,d=map(int,input().split())
mc = b//c-(a-1)//c
md = b//d-(a-1)//d
cd = (c*d)//math.gcd(c,d)
mcd = b//cd - (a-1)//cd

print(b-a+1 - mc-md+mcd)
# Judge status: Accepted
n = int(input())
train = [list(map(int, input().split())) for _ in range(n-1)]

for i in range(n):
    t = 0
    for j in range(i, n-1):
        c, s, f = train[j]
        t = max(t, s)
        t += (f - t % f) % f
        t += c
    print(t)
# Judge status: Accepted
a, b, t = map(int, input().split())
if a > t:
    print("0")
else:
    s = t//a
    print(b*s)
# Judge status: Accepted
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

a, b = inpl()
c = a-1
d = b-1
print((d+c-1)//c)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

onesum=0
twosum=0
for i in range(n):
    if(a[i]>b[i]):
        onesum+=a[i]-b[i]
    elif(a[i]<b[i]):
        twosum+=(b[i]-a[i])//2

if(onesum<=twosum):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S = input()
if 'N' in S and 'S' not in S:
    print('No')
elif 'S' in S and 'N' not in S:
    print('No')
elif 'W' in S and 'E' not in S:
    print('No')
elif 'E' in S and 'W' not in S:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
a=int(input())
if a<=104:
    ans=0
elif a<135:
    ans=1
elif a<165:
    ans=2
elif a<189:
    ans=3
elif a<195:
    ans=4
else:
    ans=5
print(ans)
# Judge status: Accepted
c1 = input()
c2 = input()
if list(c1) == list(reversed(c2)):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N,K=map(int,input().split())
x=0
while N:
  N//=K
  x+=1
print(x)
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
#print(vote)
count = 0
line = 4*M
line2 = vote//line
ans = "No"

for i in A:
    if i >= line2:
        count += 1

#print(count)
if (count > M):
    ans = "Yes"


print(ans)
# Judge status: Accepted
# 問題：https://atcoder.jp/contests/abc140/tasks/abc140_a

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

res = b[a[0]-1]
for i in range(1, n):
    res += b[a[i]-1]
    if a[i] - a[i-1] == 1:
        res += c[a[i-1]-1]

print(res)
# Judge status: Accepted
S = list(input())
S = list(set(S))

n,w,s,e = 0,0,0,0
for i in range(len(S)):
  if(S[i] == 'N'): n = 1
  elif(S[i] == 'W'): w = 1 
  elif(S[i] == 'S'): s = 1 
  elif(S[i] == 'E'): e = 1
    
judge = [n,w,s,e]
if((judge == [1,0,1,0])or(judge == [0,1,0,1])or(judge == [1,1,1,1])):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b=map(int,input().split())
m=a%b
if abs(b-m)<m:
    m=abs(b-m)
print(m)
# Judge status: Wrong Answer
a = str(input())
b = str(input())
ans = "123"
ans.replace(a,"")
ans.replace(b,"")
print(ans)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
if abs(a-c) <= d:
    print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from heapq import heapify, heappop, heappush

n, m = map(int, input().split())
arr = [-x for x in map(int, input().split())]
heapify(arr)

for _ in range(m):
    tmp = heappop(arr)
    heappush(arr, int(tmp / 2))

print(-sum(arr))
# Judge status: Accepted
N, K = map(int, input().split())
X = list(map(int, input().split()))

ans = 10**18
for l, r in zip(X, X[K - 1:]):
    if r <= 0:
        ans = min(ans, abs(l))
    if l >= 0:
        ans = min(ans, abs(r))
    if l < 0 < r:
        ans = min(ans, r - l + min(abs(r), abs(l)))
print(ans)
# Judge status: Accepted
x=int(input())
ans=x//11*2
if x%11==0:
  print(ans)
elif x%11<=6:
  print(ans+1)
else:
  print(ans+2)
# Judge status: Wrong Answer
x=int(input())
data=[x//105,x//104,x//103,x//102,x//101,x//100]
ans=0
for i in range(data[0]+1):
  for j in range(data[1]+1):
    for k in range(data[2]+1):
      for l in range(data[3]+1):
        for m in range(data[4]+1):
            if (x-(105*i+104*j+103*k+102*l+101*m))%100==0:
              print(1)
              exit()
print(0)
# Judge status: Wrong Answer
import fractions
import math

n,X= map(int,input().split())
x = list(map(int, input().split()))
ins = 0
for i in range(n):
    if x[i] >=X:
        ins = i
        break
x.insert(ins,X)
x = sorted(x)

print(x)

difflis = [0] * (n)

for i in range(n):
    difflis[i] = math.fabs(x[i+1] - x[i])

ans = difflis[0]
for i in range(i,len(difflis)):
    ans = fractions.gcd(ans,difflis[i])
print(int(ans))
# Judge status: Wrong Answer
N=int(input())
no = True
for i in range(1,10):
  for k in range(i,10):
    if N==i*k:
      print('Yes')
      no = False
      break
if no:
  print('No')
# Judge status: Accepted
d=int(input())
C=list(map(int,input().split()))
S=[list(map(int,input().split())) for i in range(d)]
A=[0]*26
for i in range(d):
    cnt=[0]*26
    for j in range(26):
        A[j]+=C[j]
        cnt[j]=S[i][j]-A[j]
    now=cnt.index(max(cnt))
    print(now+1)
    A[now]=0
# Judge status: Accepted
n = int(input())


print((n-1)*(n)//2)
# Judge status: Accepted
a,b,x = map(int, input().split())

if a <= x <= a+b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9+7
ans = pow(2, n, mod) - 1

up = 1
bo = 1
for i in range(b):
    up = up*(n-i)%mod
    bo = bo*(i+1)%mod
    if i == a-1:
        acombs = up*pow(bo, mod-2, mod)%mod

bcombs = up*pow(bo, mod-2, mod)%mod

print((ans - acombs - bcombs)%mod)
# Judge status: Wrong Answer
n,d = map(int ,input().split())
a = 2*d+1

for i in range(20):
    if a*i > n:
        print(i)

        break
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
B = tuple(map(int, input().split()))

ans = 0
for i, b in enumerate(B):
    rem = max(0, b-A[i])
    ans += min(A[i], b)
    ans += min(A[i+1], rem)
    A[i+1] = max(0, A[i+1]-rem)

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 10**9
for ai in range(min(a), max(a)+1):
    w = 0
    for aj in a:
        w += (ai - aj)**2
    ans = min(w, ans)
print(ans)
# Judge status: Accepted
X, N = map(int,input().split())
Ps =  set(map(int, input().split()))
for i in range(N+1):
    if (X-i) not in Ps:
        print(X-i)
        exit()
    elif (X+i) not in Ps:
        print(X+i)
        exit()
# Judge status: Accepted
# coding: utf-8
import heapq
n, m = map(int, input().split())
jobs = [[] for i in range(m)]
for i in range(n):
    a, b = map(int, input().split())
    if a > m:
        continue
    jobs[m-a].append(b)
ans = 0
l = []
for i in range(m-1, -1, -1):
    for j in jobs[i]:
        heapq.heappush(l, -j)
    if len(l):
        ans += -heapq.heappop(l)
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a == b:
  print(str(a) * 7)
elif a > b:
  print(str(b) * a)
else:
  print(str(a) * b)
# Judge status: Accepted
N, M, X, Y = map(int, input().split())

cities_x = [int(x) for x in input().split()]
cities_y = [int(x) for x in input().split()]

max_x = max(X, max(cities_x))
min_y = min(Y, min(cities_y))

if min_y - max_x >= 1:
  print('No War')
else:
  print('War')
# Judge status: Accepted
n=(int)(input())
a=sorted(list(map(int, input().split(" "))))
for i in range(n-1):
  if a[i] == a[i + 1]:
    print("NO")
    break
else:
  print("YES")
# Judge status: Accepted
N = int(input())
hh = list(map(int, input().split()))

for i in range(1, N):
    if hh[i - 1] == hh[i]:
        continue
    else:
        hh[i] -= 1
    if hh[i - 1] > hh[i]:
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
c = [list(map(int,input().split())) for _ in range(3)]
a = []
b = []
for i in range(3):
    a.append(abs(c[i][0]-c[i][1]))
    a.append(abs(c[i][1]-c[i][2]))
for i in range(3):
    b.append(abs(c[0][i]-c[1][i]))
    b.append(abs(c[1][i]-c[2][i]))
if a[0] == a[2] and a[2] == a[4] and b[0] == b[2] and b[2] == b[4] \
    and a[1] == a[3] and a[3] == a[5] and b[1] == b[3] and b[3] == b[5]:
    print('Yes')
    exit()
print('No')
# Judge status: Wrong Answer
def main():
    n, a, b = map(int, input().split())

    if abs(a-b) % 2 == 0:
        ans = abs(a-b) // 2
    else:
        ans = min(n - a, b - 1)

    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = 10**18
left = 0
right = sum(A)
for i in range(N):
    ans = min(ans, abs(left-right))
    left += A[i]
    right -= A[i]
print(ans)
# Judge status: Accepted
def solve():
    N, M = map(int, input().split())
    m = 10 ** 9
    for i in range(N, min(N+2019, M)):
        for j in range(N+1, min(N+2019, M)+1):
            m = min(m, i * j % 2019)
    return m

print(solve())
# Judge status: Accepted
#import 
s=input()
#=int(input())
#=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

if s[-1] == 's':
    print(s + 'es')
else:
    print(s + 's')
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
x=[]
for i in range(m):
    b,c=map(int,input().split())
    x.append([b,c])
y=sorted(x,key=lambda x:(x[1],x[0]),reverse=True)

p=0
q=0
for i in range(n):
    if a[i]<y[p][1]:
        a[i]=y[p][1]
        q+=1
    else:
        break
    if q==y[p][0]:
        p+=1

print(sum(a))
# Judge status: Accepted
s = input()
print(['no', 'yes'][len(s) == len(set(s))])
# Judge status: Wrong Answer
n = int(input())

if n==1:
  print("a")
elif n==2:
  print("aa")
  print("ab")
elif n==3:
  print("aaa")
  print("aab")
  print("abb")
  print("aba")
  print("abc")
elif n==4:
  print("aaaa")
  print("aaab")
  print("aaba")
  print("abaa")
  print("aabb")
  print("abba")
  print("abab")
  print("abbb")
  print("aabc")
  print("abac")
  print("abca")
  print("abbc")
  print("abcb")
  print("acbc")
  print("abcc")
  print("abcd")
else:
  print("")
# Judge status: Accepted
Q,H,S,D = map(int,input().split())
N = int(input())

prc2 = min(Q*8,H*4,S*2,D)
prc1 = min(Q*4,H*2,S)
print((N//2)*prc2+(N%2)*prc1)
# Judge status: Accepted
import sys
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

n = int(input())
a = list(map(int, input().split()))
# 左から
L = [0 for _ in range(n + 1)]
for i in range(n):
    L[i + 1] = gcd(L[i], a[i])

R = [0 for _ in range(n + 1)]
for i in range(n - 1, -1, -1):
    R[i] = gcd(R[i + 1], a[i])

# print(L)
# print(R)
m = 0
for i in range(n):
    m = max(m, gcd(L[i], R[i + 1]))
print(m)
# Judge status: Accepted
n = int(input())
# n = 100*a + 10*b +c
b = n%10
a = int(n/10)
if a ==9or b == 9:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
A,B,C=map(int,input().split())
K=int(input())
flag=True
for i in range(K):
    if A>B:
        B*=2
        continue
    if B>C:
        C*=2
        continue
    if C>B and B>A:
        flag=False
        break
if C>B and B>A:
    flag=False
print('Yes' if flag==False else "No")
# Judge status: Accepted
n, k = map(int, input().split())
step = list(map(int, input().split()))

ans = [float('inf')]*(10**6)

ans[0] = 0
def dp(n):
  for i in range(n):
    for j in range(k+1):
      if i+j < n:
        ans[i+j] = min(ans[i+j], ans[i] + abs(step[i+j] - step[i]))
  return ans[n-1]

print(dp(n))
# Judge status: Wrong Answer
S = input()
#list = S.split()
print(S)
flg = True
for s in range(0,len(S)-1):
    print(s)
    if s%2 == 0 and S[s] == "L":
        flg = False
    elif s%2 != 0 and S[s] == "R":
        flg = False
    
if flg:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())

res = []
for i in range(n):
  city, value = input().split()
  value = int(value)
  res.append([city, value, i])
res_s = sorted(res, key = lambda x: (x[0], -x[1]))
for i in range(n):
  print(res_s[i][2])
# Judge status: Accepted
def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        a.append(A)
        b.append(B)

    ans = b[-1] - a[-1]%b[-1]
    if a[-1]%b[-1] == 0: ans = 0

    for i in range(1, n):
        c = a[-(i+1)]+ans

        if c%b[-(i+1)] == 0: continue

        dis = b[-(i+1)]-c%b[-(i+1)]
        ans += dis

    return ans
    

print(solve())
# Judge status: Wrong Answer
n = int(input())
a = [int(x) for x in input().split()]

l = [0]*n
l[0] = a[0] - sum(a[1:])

for i in range(1,n):
    if a[i] >= 0:
        l[i] = l[i-1] + (2 * a[i])
    else:
        l[i] = l[i-1] - (2 * a[i])

abs_l = [abs(x) for x in l]
print(min(abs_l))
# Judge status: Accepted
from collections import deque
N,K = map(int,input().split(" "))
q = deque()
line = input().split(" ")
for i in range(K):
  q.append(int(line[i]))
for i in range(K,N):
  x = q.popleft()
  y = int(line[i])
  if x < y:
    print("Yes")
  else:
    print("No")
  q.append(y)
# Judge status: Accepted
def calc_sum_of_digits(num):
	ans = 0

	while True:
		if num // 10 == 0:
			ans += num
			break

		ans += num % 10
		num //= 10

	return ans


def main():
	N = int(input())
	min_sum = 1000

	for A in range(1, N):
		B = N - A

		A_sum = calc_sum_of_digits(A)
		B_sum = calc_sum_of_digits(B)

		if A_sum + B_sum < min_sum:
			min_sum = A_sum + B_sum

	print(min_sum)

  
if __name__ == "__main__":
  	main()
# Judge status: Accepted
x,a,b=map(int,input().split())
if b<=a:
  print('delicious')
elif b<=a+x:
  print('safe')
else:
  print('dangerous')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

ans = (sum(a) % mod) ** 2
for i in range(n):
    ans -= a[i] ** 2
    ans %= mod
if ans % 2 == 0:
    print(ans // 2)
else:
    print((ans + mod) // 2)
# Judge status: Wrong Answer
import sys
S = input()
K = int(input())

if len(S) == 1:
  print(S)
  sys.exit()
 
for i in range(0,K):
    if S[i] == "1":
        pass
    else:
        print(S[i])
        sys.exit()
# Judge status: Accepted
n = int(input())
a, b = map(int, input().split())
ans = 0
for i in range(a, b + 1):
  if i % n == 0:
    ans += 1
    break
print("OK" if ans == 1 else "NG")
# Judge status: Wrong Answer
fac = [0] * 700000
finv = [0] * 700000
inv = [0] * 700000
mod = 1000000007

fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, 700000):
    fac[i] = fac[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod

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

if (x + y) % 3 == 0:
    k = (2 * x - y) // 3
    l = (2 * y - x) // 3
    print(fac[k + l] * (finv[k] * finv[l] % mod) % mod)
else:
    print(0)
# Judge status: Accepted
a,b = map(int,input().split())

if a*b%2 == 1:
  print("Odd")
else:
  print("Even")
# Judge status: Accepted
dic = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
N = int(input())
for i in range(N):
  dic[input()] += 1
for i in dic:
  print(i, 'x', dic[i])
# Judge status: Accepted
N = int(input())
S = input()

num_R = len([c for c in S if c == "R"])
num_G = len([c for c in S if c == "G"])
num_B = len([c for c in S if c == "B"])

total = num_R * num_G * num_B

count = 0
for i in range(0, N - 2):
    for j in range(i, N - 1):
        k = (j - i) + j
        if k < N:
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                count += 1

print(total - count)
# Judge status: Wrong Answer
from collections import deque
N,H = map(int,input().split())
A=[]
B=[]
d=deque()
max_axe = 0
max_throw = 0
ans=0
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)

A.sort(reverse=True)
B.sort(reverse=True)
    
for i in B:
    if i>=A[0]:
        H-=i
        ans+=1
    else:
         break

ans+=int(-(-H//A[0]))

print(ans)
# Judge status: Accepted
X,K,D=map(int,input().split())
X=max(X,-X)

mostL=X-K*D
if 0<=mostL:
    print(mostL)
else:
    K-=X//D
    X%=D
    if K%2==1:
        print(abs(X-D))
    else:
        print(X)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

A_sorted = sorted(A, reverse=True)

counter = 0
edge1 = 0
edge2 = 0
flag = 0
for i in range(len(A_sorted)-1):
    if edge1 == 0 and A_sorted[i] == A_sorted[i+1]:
        edge1 = A_sorted[i]
        flag = 1
    if flag == 1 and A_sorted[i] != edge1 and A_sorted[i] == A_sorted[i+1]:
        edge2 = A_sorted[i]
        break
print(edge1*edge2)
# Judge status: Accepted
n = input()
n = n.split(" ")
n = list(map(int, n))
a = n[0]
b = n[1]

var_ = -(-(a + b) // 2)
print(var_)
# Judge status: Wrong Answer
L, R = map(int, input().split())
ans = 2019
if R - L >= 2019:
    print(0)
else:
    for i in range(L, R + 1):
        for j in range(L + 1, R + 1):
            ans = min(ans, (i * j) % 2019)
    print(ans)
# Judge status: Accepted
*ABC, = map(int, input().split())
K = int(input())

biggest = ABC.index(max(ABC))
ans = sum(ABC) - ABC[biggest] + ABC[biggest] * 2 ** K

print(ans)
# Judge status: Wrong Answer
import math
X,Y=map(int,input().split())
key=Y//X
ans=math.floor(math.log2(key))
print(ans+1)
# Judge status: Accepted
n=int(input())
#a,b=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
q=int(input())
dic={}
for a in al:
    dic[a]=dic.get(a,0)+1

total=sum(al)
ansl=[]
for i in range(q):
    b,c=map(int,input().split())
    b_num=dic.get(b,0)
    total=total+b_num*(c-b)
    ansl.append(total)
    dic[b]=0
    dic[c]=dic.get(c,0)+b_num

for ans in ansl:
    print(ans)
# Judge status: Accepted
s = input()
if s[1] == s[2] and (s[0] == s[1] or s[2] == s[3]):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N,M=map(int,input().split())
print((2*min(N,M//2)+M)//4)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if (abs(b-a)<=d and abs(c-b)<=d) or abs(c-a)<=d:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n,m = map(int, input().split())
A = [int(input()) for i in range(m)]
if m == 0:
  Fib = [1,2]
  for i in range(2,n):
    Fib.append(Fib[i-2]+Fib[i-1])
  print(Fib)
  print(Fib[n-1]%1000000007)
  exit()

B = [A[i+1]- A[i] for i in range(m-1)]
B.insert(0,A[0]+1)
B.append(n+1-A[m-1])

M = max(A)

Fib = [0,1]
for i in range(2,M+10):
  Fib.append(Fib[i-2]+Fib[i-1])

ans = 1
for i in range(len(B)):
  ans = (ans * Fib[B[i]-1])%1000000007
  
print(ans)
# Judge status: Accepted
n=int(input())
T='abcdefghijklmnopqrstuvwxyz'
s=''
while n>0:
    sn=n%26
    if sn>0:
        s=T[sn-1]+s
        n//=26
    else:
        s=T[25]+s

        n=n//26-1

print(s)
# Judge status: Accepted
# from collections import Counter, defaultdict
# n = int(input())
# li = list(map(int, input().split()))
# n = int(input())
# a, b, c = map(int, input().split())
# d = defaultdict(lambda: 0)
s = set([1, 2, 3])
s.discard(int(input()))
s.discard(int(input()))
print(*s)
# Judge status: Accepted
s = input()
cnt_1 = 0

for i in s:
    if i == '1':
        cnt_1 += 1
        
print(min(cnt_1, len(s) - cnt_1) * 2)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

def check(A,B):
    plus,minus = 0,0
    for i in range(N):
        diff = B[i]-A[i]
        if diff>0:
            plus += diff//2
        else:
            minus -= diff
    if plus >= minus:
        return True
    return False 

if check(A,B):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
k,a,b=map(int,input().split())
if b<a+2:
    print(1+k)
else:
    if k<=a:
        print(1+k)
    else:
        if (k-a-1)%2!=0:
            print(b+(b-a)*(k-a-1)//2+1)
        else:
            print(b+(b-a)*(k-a-1)//2)
# Judge status: Accepted
n, h = map(int, input().split())
a, b = [], []
for _ in range(n):
    ai, bi = map(int, input().split())
    a.append(ai), b.append(bi)
a.sort(), b.sort()

ans, amax = 0, a[-1]
for bi in b[::-1]:
    if bi <= amax or h <= 0:
        break
    h -= bi
    ans += 1
print(ans + (h + amax - 1) // amax if h > 0 else ans)
# Judge status: Wrong Answer
N=int(input())
can=[]
for i in range(1,int(N**0.5)+1):
  if N%i==0:
    can.append(N-1+N//i-1)
    

print(min(can))
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))
L.sort()
a = L[-1]
b = sum(L[:-1])
if a < b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s=list(str(input()))
t=list(str(input()))
ch=len(t)
for i in range(len(s)-len(t)):
    temp=0
    for j in range(len(t)):
        if(s[i+j]!=t[j]):
            temp+=1
    if(temp<ch):
        ch=temp
print(ch)
# Judge status: Accepted
N,M = map(int, input().split())

sets = []
for i in range(M):
  s,c = input().split()
  sets.append((s,c))

start = 0
if N != 1:
  start = 10**(N-1)

for n in range(start,10**N):
  for s,c in sets:
    if str(n)[int(s)-1] == c:
      continue
    else:
      break
  else:
    print(n)
    break
else:
  print(-1)
# Judge status: Wrong Answer
n=int(input())
k=[]
i=1
cnt=1
for i in range(n):
    l=int(input())
    k.append(l)
if k.count(2)==0:
    print(-1)
else:
    while i != 2 and cnt<=n:     
        cnt += 1
        i=k[i-1]
    if cnt>n:
        print(-1)
    else:
        print(cnt+1)
# Judge status: Wrong Answer
from collections import Counter
s=input()[::-1]
for i in range(1,len(s)):
  if all([1 if i%2==0 else 0 for i in Counter(s[i:]).values()]):
    print(len(s[i:]))
    break
# Judge status: Wrong Answer
input_angle = int(input())
input_length = input()

length = input_length.split(' ')
length.sort()
sum = 0

for i in range(input_angle-1):
  sum += int(length[i])
  
if sum > int(length[-1]):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n=int(input())
print(n//11*2+(n%11>0)+(n%11>5))
# Judge status: Wrong Answer
num = input()

count = 0
for i in range(len(num)):
    count += int(num[i])

if count % 9 == 0:
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(1, n, 2):
  if a[i] % 2 == 1:
    cnt += 1
print(cnt)
# Judge status: Accepted
a, b = map(int, input().split())
if (a*b)%2 == 1:
    print('Odd')
else:
    print('Even')
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            ans += 1 if 500*i+100*j+50*k==x else 0
print(ans)
# Judge status: Accepted
s = input()
t = input()
S = [c for c in s]
T = [c for c in t]
m = len(T)
for i in range(len(S)-len(T)+1):
  temp = 0
  for j in range(i,i+len(T)):
    if S[j] != T[j-i]:
      temp += 1
  if temp<m:
    m=temp
print(m)
# Judge status: Wrong Answer
print('YNeos'['hihihihihi'.startswith(input())^1::2])