peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
A = [int(a) for a in input().split()]
count = 0
while True:
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] //= 2
        else:
            print(count)
            exit()
    count += 1
# Judge status: Wrong Answer
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
minitemp = 10*100
for i in range(len(H)):
  H[i] = abs(t-H[i]*0.006)
  minitemp = min(minitemp,H[i])
for j in range(len(H)):
  if H[j] == minitemp:
    print(j+1)
    break
# Judge status: Accepted
a , b = map(int, input().split())
x = a-b
if x%2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))
# Judge status: Wrong Answer
from bisect import bisect_left
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
ans = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    ans += 1
print(ans)
# Judge status: Wrong Answer
S = input()
if len(S) % 2 == 0:
    mae = S[:(len(S) - 1)//2+1][::-1]
    ato = S[(len(S) - 1)//2+1:]
    ans = 0
    for i in range((len(S)-1)//2):
        if mae[i] != ato[i]:
            ans += 1
    print(ans)
else:
    mae = S[:(len(S) - 1)//2][::-1]
    ato = S[(len(S) - 1)//2+1:]
    ans = 0
    for i in range((len(S)-1)//2):
        if mae[i] != ato[i]:
            ans += 1
    print(ans)
# Judge status: Wrong Answer
N, A, B = map(int, input().split())

if ((B-A)+1)%2==0:
    print(int(B-1))
else:
    print(int((B-A)/2))
# Judge status: Accepted
n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
s=list(input())
mx=0
for i in range(1,n):
    l1=s[0:i];l2=s[i:n]
    mx=max(mx,len(set(l1) & set(l2)))

print(mx)
# Judge status: Accepted
import sys

N, M = map(int, sys.stdin.readline().split())

if N == 1 and M == 1:
    print(1)
elif N == 1 or M == 1:
    two = 2
    three = N * M - two
    print(three)
else:
    four = 4
    six = (N - 2) * 2 + (M - 2) * 2
    nine = N * M - four - six
    print(nine)
# Judge status: Wrong Answer
n=int(input())
s=0
c=0
while n>0:
  r=n%10
  s=s+r
  n=n//10
  if s%9==0:
    continue
  else:
    c=1
    print('No')
    break
if not c:
  print('Yes')
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, p = map(int, readline().split())
a = list(map(int, readline().split()))
cnt_1 = 0
cnt_2 = 0
for i in a:
    if i % 2 == 1:
        cnt_1 += 1
    else:
        cnt_2 += 1
ans = 2 ** max(0, cnt_1 - 1) * 2 ** cnt_2
if p == 1 and cnt_1 == 0:
    ans = 0
print(ans)
# Judge status: Accepted

from collections import Counter

n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
C = c.most_common()
a = C[0][1]
ans = []
for i in range(len(c)):
  if C[i][1] == a:
    ans.append(C[i][0])

ans.sort()
print(*ans,sep="\n")
# Judge status: Wrong Answer
n,d = map(int,input().split())
a = 0
ans = 0
while a < n:
  a += 2*d
  ans += 1
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
P = [0] * N
C = [1] * N
P[0] = 1
for _ in range(M):
  x, y = map(int, input().split())
  x -= 1
  y -= 1
  P[y] += P[x] / C[x]
  P[x] -= P[x] / C[x]
  C[x] -= 1
  C[y] += 1
print(sum([1 if p else 0 for p in P]))
# Judge status: Accepted
n = int(input())
h = []

for i in range(n):
    h.append(int(input()))
    
left = [0] * n
left[0] = h[0]
for i in range(1, n):
    left[i] = max(left[i - 1], h[i])

right = [0] * n
right[-1] = h[-1]
for i in reversed(range(n - 1)):
    right[i] = max(right[i + 1], h[i])

print(right[1])
for i in range(1, n - 1):
    print(max(left[i - 1], right[i + 1]))
print(left[n - 2])
# Judge status: Wrong Answer
from functools import reduce
n = int(input())
H = list(map(int, input().split()))

H[0] -= 1
for i in range(1, n):
    if H[i] < H[i-1]:
        H[i] -= 1
print('Yes' if reduce(lambda x, y: x <= y, H) else 'No')
# Judge status: Wrong Answer
N,K=map(int,input().split())
x=list(map(int,input().split()))

ans=max(x)-min(x)

for i in range(N-K+1):
    ans=min(ans,x[i+K-1]-x[i]+min(abs(x[i]),abs(x[i+K-1])))
print(ans)
# Judge status: Accepted
w = input()
flag = True
wlist = "a b c d e f g h i j k l m n o p q r s t u v w x y z".split()
for i in range(26) :
    if w.count(wlist[i]) % 2 == 1 :
        print("No")
        flag = False
        break
if flag :
    print("Yes")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=[0]*(N+1)
B[N]=A[N]
for i in range(N-1,-1,-1):
    B[i]=B[i+1]+A[i]

C=[0]*(N+1)
C[0]=1
for i in range(1,N+1):
    C[i]=2*(C[i-1]-A[i-1])

check=[min(B[i],C[i]) for i in range(N+1)]
for i in range(N+1):
    if check[i]<A[i]:
        print(-1)
        exit()
print(sum(check))
# Judge status: Wrong Answer
N = int(input())
a = [int(input()) for _ in range(5)]
print(5+N//min(a))
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())
a = max(h, w)
if n % a == 0:
    print(n//a)
else:
    print((n//a + 1))
# Judge status: Accepted
s = list(input())
K = int(input())
ans = []
for c in s:
    cnt = ord('z') - ord(c) + 1
    if c == 'a':
        ans.append('a')
    elif K >= cnt:
        K -= cnt
        ans.append('a')
    else:
        ans.append(c)
K %= 26
if 122 < ord(ans[-1]) + K:
    ans[-1] = chr(ord(ans[-1]) + K - 26)
else:
    ans[-1] = chr(ord(ans[-1]) + K)
print(*ans,sep='')
# Judge status: Accepted
import math

a, b, h, m = list(map(int, input().split()))
deg_a = (60 * h + m) * (360 / (60 * 12))
deg_b = m * (360 / 60)
deg = abs(deg_a - deg_b)
rad = math.radians(deg)

c2 = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad)
print(c2 ** 0.5)
# Judge status: Wrong Answer
N = int(input())
H = list(map(int,input().split()))

count = [0]

for i in range(1,N):
    if H[i-1] > H [i]:
        count.append(count[-1] + 1)
    else:
        count.append(0)

print(max(count))
# Judge status: Wrong Answer
N=int(input())
p=list(map(int,input().split()))

count=0
for i in range(N-1):
  if p[i] == i+1:
    p[i],p[i+1]=p[i+1],p[i]
    count += 1
print(count)
# Judge status: Wrong Answer
N = int(input())

res = 0
for i in range(9):
    tmp = i * 111
    if tmp >= N:
        res = tmp
        break
print(res)
# Judge status: Wrong Answer
N, A, B = map(int, input().split())
num = A * N // (A + B)
if N % (A + B) > A:
  print(num + A)
else:
  print(num + (N % (A + B)))
# Judge status: Wrong Answer
a,b,c,k = list(map(int, input().split()))
if a + b >= k:
  print(a)
else:
  print(2 * a + b - k)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

def main():
    n = int(input())

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

    total = sum(stick)
    mid = total // 2

    cum = 0
    midi = 0
    for i, block in enumerate(stick):
        cum += block
        if cum >= mid:
            midi = i
            break

    l1 = cum
    r1 = total - l1
    diff1 = abs(l1 - r1)
    
    l2 = l1 + stick[midi]
    r2 = r1 - stick[midi]
    diff2 = abs(l2 - r2)
    
    print(min(diff1, diff2))

main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Sun May 31 21:07:49 2020

@author: NEC-PCuser
"""

A, B = map(str, input().split())
A = int(A)
B = float(B) * 1000 // 1

C = A * int(B) // 1000
print(C)
# Judge status: Wrong Answer
A,B = map(int,input().split())
if A <= 5:
  print(0)
elif A <= 12:
  print(B/2)
else:
  print(B)
# Judge status: Accepted
n, x, t = map(int, input().split())
print(t * ((n + x - 1) // x))
# Judge status: Accepted
def main():
    n = int(input())
    a = [int(v) for v in input().split()]
    x = 0
    for i in range(n):
        x ^= a[i]
    for i in range(n):
        print(x ^ a[i])

main()
# Judge status: Accepted
x,y=map(int,input().split())
import math
xx=math.factorial(x)
yy=math.factorial(y)
if x==y:
    print(xx*yy*2%((10**9)+7))
elif abs(x-y)==1:
    print(xx*yy%((10**9)+7))
else:
    print(0)
# Judge status: Wrong Answer
import math

a,b = map(int, input().split())
print(b/a)
n= math.floor(math.log2(b/a))
print(n+1)
# Judge status: Accepted
import numpy as np
MOD = 10 ** 9 + 7
N = int(input())
A = np.array(list(map(int, input().split())))
ans = 0
for n in range(60): # または、range(60)またはrange(len(bin(max(A))))
    cnt_1 = np.count_nonzero((A>>n)&1)
    cnt_0 = N - cnt_1
    ans += (cnt_1 * cnt_0 * (2 ** n)) % MOD
ans %= MOD
print(ans)
# Judge status: Accepted
N = int(input())
S = input()

if N%2 == 1:
    print("No")
else:
    count = 0
    for i in range(N//2):
        if S[i] == S[i+N//2]:
            count+=1
    if count == N//2:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N = int(input())

S = N*(N+1)//2

print(S)
# Judge status: Wrong Answer
s = int(input())

def f(n):
  if n % 2 == 0:
    return n//2
  else:
    return 3*n+1

cnt = 1
k = s
while(True):
  k = f(k)
  cnt += 1
  if k == 4:
    ans = cnt+3
    break

print(ans)
# Judge status: Wrong Answer
S=list(input())
X=753
ans=0
for i in range(len(S)-2) :
    for j in range(0,8,1) :
        if int(S[i]) == j :
            demo = int(S[i]+S[i+1]+S[i+2])
            if demo >= ans :
                ans = demo
print(abs(X-ans))
# Judge status: Accepted
n=int(input())
if n%2==0:
    print("0.5")
if n%2==1:
    print((int(n/2)+1)/n)
# Judge status: Accepted
from collections import Counter as Ct
print('Yes' if sorted(Ct(input()).values()) == sorted(Ct(input()).values()) else 'No')
# Judge status: Wrong Answer
n,k,q =map(int,input().split())
ans=[0]*n
for i in range(q):
    a=int(input())
    ans[a-1]+=1
for i in range(n):
    if 0 <=ans[i]<=q-k and q-k>0:
        print("No")
    else:
        print("Yes")
# Judge status: Accepted
A, B, C = map(int, input().split())
ans = 0
while True:
    # print(A, B, C)
    if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        if A == B == C:
            print(-1)
            exit()
        ans += 1
        tA = A
        tB = B
        tC = C
        A = tB//2 + tC//2
        B = tA//2 + tC//2
        C = tB//2 + tA//2
    else:
        print(ans)
        exit()
# Judge status: Accepted
#AGC031 A Colorful Subsequence
# Answer
N = int(input())
S = input()
alpha = [0]*26
mod = 10**9+7

for n in S:
    num = ord(n)-97
    alpha[num] += 1
    
ans = 1
for i in range(26):
    ans *= (alpha[i]+1)

# ans %= mod
print(ans%mod-1)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
ans = 0
for i in range(n):
    ans += A[1 + 2*i]
print(ans)
# Judge status: Accepted
##import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    if s-i>2*k:
        continue
    else:
        for j in range(k+1):
            if s-i-j>k or s-i-j<0:
                continue
            else:
                ans+=1
print(ans)
# Judge status: Accepted
a = list(map(int, input().split()))
ans = 0
for i in range(a[0], a[1]+1):
    t = str(i)
    flag = True
    for j in range(len(t)//2):
        if t[j]!=t[len(t)-1-j]:
            flag = False
    ans += 1 if flag else 0
print(ans)
# Judge status: Wrong Answer
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
d=dict(Counter(a))
ans=sum(a)
q=int(input())
for _ in range(q):
    b,c=map(int,input().split())
    if b not in d.keys(): continue
    ans+=(c*d[b]-b*d[b])
    print(ans)
    if c in d.keys(): d[c]+=d[b]
    else: d[c]=d[b]
    d[b]=0
# Judge status: Accepted
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    s = input().rstrip()
    first = ord("A") - 1
    last = ord("Z")
    increment = lambda x: chr(ord(x)+n) if ord(x)+n <= last else chr(first + (ord(x)+n - last))
    new_s = "".join(map(increment, s))
    print(new_s, end="")
    


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
k = int(input())
a,b = map(int,input().split())

wk = (b//k)
if wk*k >=a:
    print('Ok')  
else:
    print('NG')
# Judge status: Accepted
n = int(input().replace(" ", ""))
for i in range(1, 320):
    if i**2 == n:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
n=int(input())
print('ABC'if n<=999 else 'ABD' )
# Judge status: Accepted
n = int(input())
l1 = 2
l2 = 1
l = 1
for i in range(n-1):
    l = l1+l2
    l1, l2 = l2, l
print(l)
# Judge status: Wrong Answer
x,k,d = [int(i) for i in input().split()]
ans = x%d

if x > d and k <= x//d:
    ans = x - k*d
else:
    k = k-x//d
    if k%2 == 0:
        ans = x % d
    elif k%2 == 1:
        ans = d - x%d
print(ans)
# Judge status: Wrong Answer
s = input()

if s == "abc" or s == "bac" or s == "cba" or s == "acb":
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,k=map(int, input().split())
a=list(map(int, input().split()))

sei=[0]*(n-k+1)
for i in range(n-k+1):
  for j in range(i,i+k):
    sei[i]+=a[j]

for i in range(n-k):
  if sei[i]<sei[i+1]:
    print("yes")
  else:
    print("no")
# Judge status: Wrong Answer
import math  # noqa: F401
from typing import Dict, List, Optional, Tuple, Union  # noqa: F401


def sum_xor(A: List[int]) -> int:
    sum_ = 0
    for a in A:
        sum_ ^= a
    return sum_


def main(N: int, A: List[int]):
    sum_ = sum_xor(A)
    for a in A:
        print(a ^ sum_, end="")
    print()


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    main(N, A)
# Judge status: Wrong Answer
S = input("Enter words: ")
T = input("Enter another words: ")

if S in T:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import itertools
x=list(map(int,input().split()))
k=int(input())
L=list(itertools.combinations_with_replacement([0,1,2],k))
for l in L:
    X=x.copy()
    for i in l:
        X[i] = X[i]*2
    if X[0]<X[1] and X[1]<X[2]:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
w, a, b = map(int, input().split())
ans = 0
if a < b:
  if a+w > b:
    ans = 0
  else:
    ans = b - (a+w)
elif a == b:
  ans = 0
 
else:
  if b+w > a:
    ans = 0
  else:
    ans = a - (b+w)
 
print(ans)
# Judge status: Accepted

def resolve():
    A, B = list(map(int, input().split()))
    if A == B:
        print("Draw")
        return
    if A == 1:
        A = 14
    if B == 1:
        B = 14
    
    if A > B: 
        print("Alice")
    else:
        print("Bob")


if '__main__' == __name__:
    resolve()
# Judge status: Accepted
c = [list(map(int,input().split())) for _ in range(3)]

e = c[0][1] - c[0][0]
f = c[0][2] - c[0][1]

if any(e != c[x][1]-c[x][0] for x in [1,2]) or any(f != c[x][2]-c[x][1] for x in [1,2]) :
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
W, H, n = map(int, input().split())

one = 0
two = W
three = 0
four = H
for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        one = max(one, x)
    elif a == 2:
        two = min(two, x)
    elif a == 3:
        three = max(three, y)
    elif a == 4:
        four = min(four, y)

w = W - (one + (W - two))
h = H - (three + (H - four))
print(max(0, w*h))
# Judge status: Accepted

from sys import stdin

n = int(stdin.readline().rstrip())
s = [stdin.readline().rstrip() for i in range(n)]
d = {}
dl = []
for i in range(26):
    d.update({chr(i + 97): 0})
for i in range(n):
    dl.append(d.copy())
for i in range(n):
    for si in s[i]:
        dl[i][si] += 1
ans = ''
for al in range(26):
    tmp = 10**9+7
    for i in range(n):
        if tmp > dl[i][chr(al + 97)]:
            tmp = dl[i][chr(al + 97)]
    ans += (tmp * chr(al + 97))

print(ans)
# Judge status: Wrong Answer
A = int(input())
if A%2==1:
    A = (A/2)+0.5
else:
    A =A/2
print(A)
# Judge status: Accepted
s=input()
n=len("s")
q=int(input())
l=[]
start=""
end=""
m=0
for i in range(q):
    l.append(input())
    if l[i]=="1":
        m += 1

    else:
        due,f,c=l[i].split()
        if (f=="1" and m % 2==0) or (f !="1" and m % 2==1) :
            start += c
        else:
            end += c
if m % 2 ==0:

    start=start[::-1]
    s = start + s + end

else:
    s = s + end
    s = s[::-1]
    s = s + start

print(s)
# Judge status: Wrong Answer
n, m=map(int, input().split())
a=list(map(int, input().split()))
change=[]

for i in range(m):
    b, c=map(int, input().split())
    change.append((c, b))

change=sorted(change, reverse=True)
elem=0

for c, b in change:
    while elem<n and b>0:
        if a[elem]<c:
            a[elem]=c
            b-=1
        elem+=1

print(sum(a))
# Judge status: Accepted
N=int(input())
print(int(N**(1/2)//1)**2)
# Judge status: Wrong Answer
S=input()
cnt=0
ans=0
for i in S:
    if i in ["A","C","G","T"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
print(ans)
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n,m = i2()
ans = [0]*n
for i in range(m):
	a,b = i2()
	ans[a-1] += 1
	ans[b-1] += 1 
	
for i in range(n):
	print(ans[i])
# Judge status: Wrong Answer
N = int(input())
ans = N

for i in range(N+1):
  j = N-i
  ist = str(i)
  jst = str(j)
  iarray = list(map(int ,ist))
  jarray = list(map(int ,jst))
  isum = sum(iarray)
  jsum = sum(jarray)
  if isum + jsum < ans:
    ans = isum + jsum
print(ans)
# Judge status: Accepted
x = input()
if x == "0":
    print(1)
elif x == "1":
    print(0)
# Judge status: Accepted
K=int(input())
S=input()
if len(S)<=K:
    print(S)
else:
    D=list(S)
    del D[K:]
    D.append("...")
    print(*D, sep="")
# Judge status: Accepted
n = input()
l = len(n)
a = [0 for _ in range(2019)]
a[0] = 1
now = 0
ten = [1]
for i in range(l-1):
  ten.append(ten[-1]*10%2019)
ten.reverse()
for i in range(l)[::-1]:
  now += ten[i]*int(n[i])
  now %= 2019
  a[now] += 1
  #print(now)
ans = 0
for d in range(2019):
  ans += a[d] * (a[d]-1) // 2
print(ans)
# Judge status: Accepted
# coding: utf-8
from collections import Counter
S = input()
if len(S) == 1:
    print("YES")
    exit()
cv = []
for alp in ["a", "b", "c"]:
    cv.append(S.count(alp))
cv.sort()
l = []
for i in range(2):
    for j in range(i+1, 3):
        l.append(abs(cv[i] - cv[j]))
for i in range(len(l)):
    if l[i] > 1:
        print("NO")
        exit()
print("YES")
# Judge status: Wrong Answer
N=int(input())
A=int(input())
ans=N%500
if ans-A<=0:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
h1,m1,h2,m2,k=map(int,input().split())
h3=h2-h1
h3=h3*60+m1+m2

print(h3-k)
# Judge status: Accepted
N = int(input())
L = [tuple(map(int, input().split())) for _ in range(N)]
L.sort(key=lambda x: x[0]+x[1])
a = abs(L[0][0]-L[-1][0])+abs(L[0][1]-L[-1][1])
L.sort(key=lambda x: x[0]-x[1])
b = abs(L[0][0]-L[-1][0])+abs(L[0][1]-L[-1][1])
print(max(a, b))
# Judge status: Accepted
L, R = map(int, input().split())

if R-L >= 2019:
    print(0)
    exit()

for i in range(L,R+1,1):
    if i%2019 == 0:
        print(0)
        exit()

ans = 2018
for i in range(L,R+1,1):
    for j in range(i+1,R+1,1):
        x = (i*j)%2019
        if x<ans:
            ans = x

print(ans)
# Judge status: Accepted
a,b,x=[int(i) for i in input().split()]

def get_mod_num(limit,x):
    if limit==-1:
        return 0
    return limit//x+1

print(get_mod_num(b,x)-get_mod_num(a-1,x))
# Judge status: Accepted
import sys

x,n = map(int,input().split())
p = list(map(int,input().split()))

t = True
i,j=0,0

if x not in p:
    print(x)
    sys.exit()

i,j=1,1

while t:
    ans = x+i*(-1)**j
    if ans in p:
        if j == 2:
            j = 1
            i += 1
        else:
            j += 1    
    else:
        t = False

print(ans)
# Judge status: Wrong Answer
n, x, t = map(int, input().split())
print((n//x + 1)*t)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0

for i in range(N):
  # i番目の街のモンスターを倒せるだけ倒す
  tmp = min(A[i], B[i])
  ans += tmp
  A[i] -= tmp
  B[i] -= tmp
  
  # i+1番目の街のモンスターを倒せるだけ倒す
  tmp2 = min(A[i+1],B[i])
  ans += tmp2
  A[i+1] -= tmp2
  B[i] -= tmp2
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

chars = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

def get_str(seq_list):
    result = []
    for seq in seq_list:
        used_char_num = len(set(seq))
        for i in range(used_char_num + 1):
            result.append(seq + chars[i])
    return result

N = int(input())

seq_list = ["a"]
for i in range(N - 1):
    tmp = seq_list[:]
    seq_list = get_str(tmp)

for s in seq_list:
    print(s)
# Judge status: Accepted
L, R, d = map(int, input().split())
count = 0
for i in range(L, R+1):
    if i %d == 0:
        count += 1

print(count)
# Judge status: Accepted
N = int(input())
u = []
v = []
for _ in range(N):
    x,y = map(int,input().split())
    u.append(x+y)
    v.append(x-y)

umax = max(u)
umin = min(u)
vmax = max(v)
vmin = min(v)

print(max(umax-umin,vmax-vmin))
# Judge status: Accepted
from fractions import gcd

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

if c%g == 0:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
from bisect import bisect
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
a = [0] * (N+1)
b = [0] * (M+1)
for i in range(N):
    a[i+1] = a[i] + A[i]
for i in range(M):
    b[i+1] = b[i] + B[i]
ans = 0
for i in range(N+1):
    tmp = K - a[i]
    if tmp < 0:
        break
    ans = max(ans, i + bisect(b, tmp) - 1)
print(ans)
# Judge status: Wrong Answer
S = int(input())

dp = [0] * (S+1)

dp[0] = 1

for i in range(S+1):
  for j in range(0,(i-3)+1):
    dp[i] += dp[j]
    dp[i] %= 10**9+7

print(dp[-1] % 10**9+7)
# Judge status: Accepted
import collections
N = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
ans = 0
for key in C.keys():
    if key > C[key]:
        ans += C[key]
    elif key < C[key]:
        ans += C[key]-key
print(ans)
# Judge status: Accepted
a,b,c = map(int, raw_input().split())
print 'Yes' if a + b >= c else 'No'
# Judge status: Accepted
S = input()

if int(S[0:4]) < 2019 :
	print("Heisei")
elif int(S[0:4]) == 2019 and int(S[5:7]) <= 4:
	print("Heisei")
else:
	 print("TBD")
# Judge status: Accepted
c = 0
for i in range(1, int(input())+1):
  if not i%2:
    continue
  if sum(not(i%j) for j in range(1, i+1))==8:
    c += 1
print(c)
# Judge status: Accepted
r = int(input())
print(2*r*3.14)
# Judge status: Accepted
N=int(input())
S=list(map(int,input().split()))


T=sum(S)
L=sum(S)
M=0
U=[]
Q=T/2
for i in range(len(S)):
  M=M+S[i]
  T=T-S[i]
  L=min(L,abs(M-T))
print(L)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
ans = A[0]

for i in range(1,N):
    ans = (ans + A[i])/2

print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
from collections import Counter
cc=Counter(a)
l=[]
for i in cc:
    l.append([cc[i],i])
l.sort(key=lambda x: -x[0] )
#print(l)
su=0
for i in range(min(k,len(l))):
    su+=l[i][0]
print(n-su)
# Judge status: Wrong Answer
import bisect

n=int(input())

list_A=sorted(list(input().split(' ')))
list_B=sorted(list(input().split(' ')))
list_C=sorted(list(input().split(' ')))
ans=0
for i in list_B:
	a=bisect.bisect_left(list_A, i)
	b=bisect.bisect_right(list_C, i)
	ans += a*(n-b)
print(ans)
# Judge status: Wrong Answer
n = int(input())
x = 0
for i in range(10) :
    if 1000*i>n and x == 0:
        x = i

print(1000*x-n)
# Judge status: Accepted
X=int(input())
i=1

while True:
  if X*i%360==0:
    print(i)
    break
  i+=1
# Judge status: Wrong Answer
n=int(input())
start=n
ans=0
for i in range(2,int((n+1)**0.5)):
    if(n%i==0):
        for j in range(1,100):
            if(n%(i**j)==0):
                ans+=1
                n/=i**j
            else:
                break
    if(n==1):
        break
if(n==start and start!=1):
    ans+=1
print(ans)
# Judge status: Accepted
a,b,k=map(int,input().split())
if k<=a:print(a-k,b)
elif k<=a+b:print(0,b-k+a)
else:print(0,0)
# Judge status: Accepted
r = int(input())

import math

print(math.pi*2*r)
# Judge status: Accepted
s=input()
l=len(s)
a=[]
for i in range(l):
  n=len(a)
  if s[i]=='0':
    a.append(0)
  elif s[i]=='1':
    a.append(1)
  elif s[i]=='B':
    if a!=[]:
      del a[n-1]
    
for i in range(len(a)):
  print(a[i],end="")