peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
L,R=map(int,input().split())
if (R-L>3000) :
    print(0)
else :
    ans=2019
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans=min(ans,i*j%2019)
    print(ans)
# Judge status: Wrong Answer
N,D=map(int,input().split())

out = N/(2*D+1)
if out <= 1:
  print(1)
else:
  print(round(out+0.5))
# Judge status: Wrong Answer
s = list(map(int,input().split()))
m0 = 0
m1 = 0
for i in range(len(s)):
    if s[i]==0:
        m0+=1
    else:
        m1+=1
print(min(m0,m1)*2)
# Judge status: Accepted
l=list(int(input()) for _ in range(5))
s=list(10-i%10 for i in l)
for i in range(s.count(10)):
  s.remove(10)
if len(s)>0:
  s.remove(max(s))
print(sum(l)+sum(s))
# Judge status: Accepted
A, B, C = map(int, input().split())
if (A == B and A != C) or (A == C and A != B) or (B == C and A != B):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
from collections import *

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

if A>B:
    print(0)
    exit()
    
low = A+B+(N-2)*A
high = A+B+(N-2)*B
print(high-low+1)
# Judge status: Wrong Answer
n,T = map(int,input().split())
ct = []
mn = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t:
        if mn > c:
            mn = c
print("TLE" if mn==10**9 else mn)
# Judge status: Wrong Answer
a,b,k = map(int,input().split())
ans = []
for i in range(a,a+k):
    if i <= b:
        ans.append(i)
for i in range(b-k+1,b+1):
    if i >= a:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

i = int(1)
for i in a:
    if i > n:
        break
    else:
        print(a.count(i))
# Judge status: Wrong Answer
import math
S = int(input())
n = S // 3
ans = 0
for k in range(1, n):
  ans = ans + math.factorial(S - 2 * k + 1)/(math.factorial(k - 1) * math.factorial(S - k + 2))
print(ans % (10 ** 9 + 7))
# Judge status: Accepted
X,Y=map(int,input().split())
#a,bをかめとつるの数とする、これはそんなに量多くないので行ける
for a in range(X+2):
    if a==X+1:
        print("No")
    elif (Y-4*a)%2==0 and int((Y-4*a)/2)==X-a:
        print("Yes")
        break
    else:
        continue
# Judge status: Wrong Answer
A, B = list(map(int, input().split()))

large = A if A > B else B
small = A if A < B else B

multi = small

r = large % small
while r != 0:
    multi = r
    r = small % r

print(int(large/multi*small))
# Judge status: Accepted
from collections import Counter
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *l = map(int, read().split())

c = Counter(l)
sides = sorted([[x, y] for x, y in c.items() if y >= 2])
ans = 0

if len(sides) == 1:
    if sides[-1][1] >= 4:
        ans = sides[-1][0] ** 2
elif len(sides) >= 2:
    if sides[-1][1] >= 4:
        ans = sides[-1][0] ** 2
    else:
        ans = sides[-1][0]*sides[-2][0]
print(ans)
# Judge status: Accepted
N = int(input())
d = [[], []]
for i in range(N):
    x, y = map(int, input().split())
    d[0].append(x-y)
    d[1].append(x+y)

ans = 0
for i in range(2):
    ans = max(ans, max(d[i])-min(d[i]))
print(ans)
# Judge status: Wrong Answer
import numpy as np

N, K = map(int, input().split())
S = np.array(list(input()))
S = (S == 'L') * 1
inner01 = 0
outer10 = 0
happy = 0
for i in range(N - 1):
    if S[i] == S[i + 1]:
        happy += 1
    elif S[i] - S[i + 1] == 1:
        outer10 += 1
    else:
        inner01 += 1
up = min(inner01, min(K, outer10))
happy += 2 * up
if K - up >= 1 and outer10 - up >= 1 and S[0] == 1:
    happy += 1
if K - up >= 2 and outer10 - up >= 2 and S[-1] == 0:
    happy += 1

print(happy)
# Judge status: Accepted
(a, b) = list(map(int, input().split()))


if a < b:
    print(str(a) * b)
else:
    print(str(b) * a)
# Judge status: Wrong Answer
from collections import Counter

N = int(input())
S = list(input())

c = Counter(S)
ans = c["R"] * c["G"] * c["B"]

if ans == 0:
    print(0)
    exit()

for n_skip in range(1, N//3 + 10):
    for i in range(N):
        try:
            if set(["R", "G", "B"]) == set([S[i], S[i+n_skip], S[i + 2*n_skip]]):
                ans -= 1
        except IndexError:
            break

print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().split())
p = 0
for i in range(m):
    print(n//2-p,n//2+1+p)
    p += 1
# Judge status: Accepted
N = int(input())

SUM = 0

for i in range(1, N + 1):
    if i % 3 != 0:
        if i % 5 != 0:
            SUM += i

print(SUM)
# Judge status: Accepted
N= int(input())
a=sorted(map(int,input().split()))[::-1]
print(sum(a[::2])-sum(a[1::2]))
# Judge status: Accepted
k, x = map(int, input().split())
ans = 'No'
if (500*k>=x):
    ans = 'Yes'
print(ans)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

cnt = 0
for i in range(1, n-1):
    if p[i-1] <= p[i]:
        if p[i] < p[i+1]:
            cnt += 1
    else:
        if p[i] >= p[i+1]:
            cnt += 1
print(cnt)
# Judge status: Accepted
w, h, n = map(int, input().split())
a1, a2, a3, a4 = [0], [w], [0], [h]
for _ in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        a1.append(x)
    if a == 2:
        a2.append(x)
    if a == 3:
        a3.append(y)
    if a == 4:
        a4.append(y)
print(max(min(a2) - max(a1), 0) * max(min(a4) - max(a3), 0))
# Judge status: Accepted
l = float(input())
print('%.18f' % (l / 3.) ** 3)
# Judge status: Accepted
X = int(input())

rate = 0
if X >= 1800:
    rate = 1
elif X >= 1600:
    rate = 2
elif X >= 1400:
    rate = 3
elif X >= 1200:
    rate = 4
elif X >= 1000:
    rate = 5
elif X >= 800:
    rate = 6
elif X >= 600:
    rate = 7
else:
    rate = 8

print(rate)
# Judge status: Accepted
n,m = map(int,input().split())
ab = [0]*n
V = [[] for i in range(m+1)]
for i in range(n):
    a,b = map(int,input().split())
    if a <= m:
        V[a].append(-b)

import heapq
q = []
ans = 0
heapq.heapify(q)
for i in range(1,m+1):
    for v in V[i]:
        heapq.heappush(q,v)

    if len(q) == 0:
        pass
    else:
        ans -= heapq.heappop(q)
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
isAC = [False for _ in range(N)]
correct = 0
penalty = [0 for _ in range(N)]
for _ in range(M):
    tmp = input().split()
    pi, Si = int(tmp[0]), tmp[1]
    if not isAC[pi-1]: # すでにAC
        if Si == 'AC':
            isAC[pi-1] = True
            correct += 1
        else:
            penalty[pi-1] += 1
pnl = 0
for idx in range(N):
    if isAC[idx]:
        pnl += penalty[idx]
print(correct, pnl)
# Judge status: Wrong Answer
n = int(input())
lst1 = list(map(int,input().split()))

lst2 = [0]*8

for i in range(n):
    for j in range(8):
        if lst1[i] < 400*(j+1):
            lst2[j] += 1
            break
    if lst1[i] >= 3200:
        lst2[7] += 1

ans = 0
for i in range(8):
    if lst2[i]:
        ans += 1

print(max(1,ans))
print(ans+lst2[7])
# Judge status: Accepted
N = int(input())
S = input()

if N % 2 != 0:
 print('No')
else:
 half = N // 2
 if S[:half] == S[half:]:
  print('Yes')
 else:
  print('No')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

defeat_monster = 0
for i in range(n):
    defeat_monster += min(b[i] - min(b[i], a[i]), a[i + 1])
    defeat_monster += min(b[i], a[i])

print(defeat_monster)
# Judge status: Accepted
s = input()
t = input()
cnt = 0
for (x, y) in zip(s, t):
  if x != y:
    cnt += 1
print(cnt)
# Judge status: Accepted
N, = list(map(int, input().split()))
A = list(map(int, input().split()))

if all(x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0):
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
def five(x):
    return x.index(0)+1

if __name__ == "__main__":
    x = list(map(int,input().split()))
    print(five(x))
# Judge status: Accepted
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    #res = 0
    #a, b, c = map(int, r.split())
    res = sorted(list(r))
    if "".join(res) == 'abc':
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b = map(int, input().split())
print("-1" if a<=b<=9 else a*b)
# Judge status: Wrong Answer
n,h = map(int, input().split())
A = 0
B = []
for _ in range(n):
    a,b = map(int, input().split())
    if A < a: A = a
    B.append(b)
B.sort(reverse=True)
hit = 0
cnt = 0
for i in range(n):
    if hit >= h: break
    if A < B[i]: 
        hit += B[i]
        cnt += 1
    else: break
if hit >= h: print(cnt)
else: 
    a = (h-hit)/A
    if a - int(a) < 0.5: print(cnt + (h-hit)//A)
    else: print(cnt + (h-hit)//A + 1)
# Judge status: Accepted
A,B,C=map(int,input().split())

if A<C and C<B:
    print("Yes")
elif B<C and C<A:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    N = int(input())
    if N >= 1000:
        print('ABD')
    else:
        print('ABC')
main()
# Judge status: Wrong Answer
S = list(input())
n = len(S)
ans = "Yes"

for i in range(1, n):
    if i % 2 == 0:
        if not any([S[i-1]=='L', S[i-1]=='U', S[i-1]=='D']):
            ans = "No"
            break
        else:
            continue
    else:
        if not any([S[i-1]=='R', S[i-1]=='U', S[i-1]=='D']):
            ans = "No"
            break
        else:
            continue

print(ans)
# Judge status: Accepted
digits = input()
digits = list(map(int, digits[::-1]))
digits.append(0)

ans = 0
for i in range(len(digits)):
    if digits[i] < 5:
        ans += digits[i]
    elif digits[i] == 5:
        if digits[i + 1] < 5:
            ans += digits[i]
        else:
            digits[i + 1] += 1
            ans += 10 - digits[i]
    else:
        # digits[i] > 5
        digits[i + 1] += 1
        ans += 10 - digits[i]

print(ans)
# Judge status: Accepted
x = int(input())
def Main(x):
    d, m = divmod(x, 11)
    if m == 0:
        return d*2
    else:
        return d*2+(m-1)//6+1
    
print(Main(x))
# Judge status: Wrong Answer
n = int(input())
print((n+1)/(2*n))
# Judge status: Accepted
s = int(input())
ans = [s]
bool = True
while bool==True:
	if ans[-1] % 2 == 0:
		tmp = int(ans[-1] / 2)
		ans.append(tmp)
	else:
		tmp = int((ans[-1]*3)+1)
		ans.append(tmp)
	num = []
	for index,a in enumerate(ans):
		if a in num:
			print(index+1)
			bool = False
		num.append(a)
# Judge status: Accepted
N=int(input())
X=list(map(int,input().split()))
P=round(sum(X)/N)
print(sum((x-P)**2 for x in X))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(["NO","YES"][2*b-a-c!=0])
# Judge status: Accepted
def main():
    L = int(input())
    l = L/3
    print(l*l*l)


main()
# Judge status: Wrong Answer
N,A,B,C,D = map(int, input().split())
S = input()

if C < D:
    if "##" in S:
        print("No")
    else:
        print("Yes")
else:
    if "..." in S and "##" not in S:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
s = input()
s_list = [s[_] for _ in range(len(s))]

output = list()
for c in s_list:
  if c == '0':
    output.append('0')
  elif c == '1':
    output.append('1')
  else:
    if len(output) > 0:
      output.pop()
print(''.join(output))
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
C=list(map(int, input().split()))

ans=sum(B)

for i in range(N-1):
    if A[i+1]==A[i]+1:
        ans+=C[A[i]-1]

print(ans)
# Judge status: Wrong Answer
n = input()
# print(n[len(n) - 1])
if "2" == n[len(n) - 1] or "5" == n[len(n) - 1] or "7" == n[len(n) - 1] or "9" == n[len(n) - 1]:
    print("hon")
elif "0" == n[len(n) - 1]or "1" == n[len(n) - 1] or "6" == n[len(n) - 1] or "8" == n[len(n) - 1]:
    print("pon")
elif "3" == n[len(n) - 1]:
    print("bon")
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  A=500*i
  if A>x:
    break
  for j in range(b+1):
    B=100*j
    k = (x - A - B)/50
    if 0<=k<=c and k%1==0:
      ans+=1
print(ans)
# Judge status: Accepted
n=int(input())
w=[int(x) for x in input().rstrip().split()]
SUM=sum(w)

now=0
ans=float('inf')
for i in w:
  now+=i
  ans=min(abs(now-(SUM-now)),ans)
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
print(a*b if a < 10 and b < 10 else -1)
# Judge status: Wrong Answer
x, y = map(int, input().split())

ans = int(1e9)

# B(0) --> A --> B(0)
if x <= y:
    ans = min(ans, y - x)

# B(1) --> A --> B(0)
if -x <= y:
    ans = min(ans, y + x + 1)

# B(0) --> A --> B(1)
if x <= -y:
    ans = min(ans, -y - x + 1)

# B(1) --> A --> B(1)
if -x <= -y:
    ans = min(ans, -y + x + 2)

print(ans)
# Judge status: Wrong Answer
from collections import deque
n, m = map(int, input().split())
ab = [[] for i in range(n+1)]

for i in range(m):
    a, b = map(int, input().split())
    ab[a].append(b)
    ab[b].append(a)

ans = [-1]*(n+1)
que = deque([1])

while que:
    q = que.popleft()
    for i in ab[q]:
        if ans[i] == -1:
            que.append(i)
            ans[i] = q

print("YES")

for i in range(2,n+1):
    print(ans[i])
# Judge status: Wrong Answer
def resolve():
    import bisect
    N = int(input())
    A = sorted([int(i) for i in input().split()])
    if N == 2:
        print(max(A), min(A))
        return
    maxA = A[-1]
    half = maxA / 2
    i = bisect.bisect_left(A, half)
    if half - A[i] < A[i + 1] - half:
        print(maxA, A[i])
    else:
        print(maxA, A[i + 1])


resolve()
# Judge status: Accepted
n = int(input())
als = list(map(int, input().split()))

als.sort()

my_dict = dict()

for item in als:
    if item in my_dict:
        my_dict[item] += 1
    else:
        my_dict[item] = 1


ret = 0
for item in my_dict:
    val = my_dict[item]
    if val < item:
        ret += val
    else:
        ret += (val - item)

print(ret)
# Judge status: Accepted
a, b = map(int, input().split())

if (b - 1) % (a - 1) == 0:
    print((b - 1) // (a - 1))
else:
    print((b - 1) // (a - 1) + 1)
# Judge status: Accepted
S=input()
T=input()

if S[0]==T[2] and S[1] ==T[1] and S[2]==T[0]:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import collections
n = int(input())
d = list(map(int,input().split()))
ma = max(d)
mod = 998244353

if d[0] != 0:
    print(0)
    exit()

p = [0 for i in range(ma+1)]

for i in range(n):
    p[d[i]] += 1

if p[0] != 1:
    print(0)
    exit()
else:
    ans = 1
    for i in range(1,ma+1):
        ans *= (p[i-1]**p[i])%mod
        ans %= mod
    
    print(ans)
# Judge status: Accepted
a = list(input())
b = list(input())
c = list(input())
x = a.pop(0)
while True:
  if x == "a":
    if not a:
      print("A")
      break
    x = a.pop(0)
  if x == "b":
    if not b:
      print("B")
      break
    x = b.pop(0)
  if x == "c":
    if not c:
      print("C")
      break
    x = c.pop(0)
# Judge status: Accepted
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

def gcd(n, m):
    if m > n:
        n, m = m, n
    if m == 0:
        return n
    r = 0
    while n % m != 0:
        r = n % m
        n = m
        m = r
    return m

def lcm(n, m):
    return n * m // gcd(n, m)

def lcm_vec(v):
    r = v[0]
    for i in v[1:]:
        r = lcm(r, i)
    return r

print(lcm_vec(a))
# Judge status: Accepted
n = int(input())
a_list = [int(x) for x in input().split()]
b_list = [int(x) for x in input().split()]

ans = 0
for i in range(n):
    for j in range(2):
        temp = min(a_list[i + j], b_list[i])
        ans += temp
        a_list[i + j] -= temp
        b_list[i] -= temp
print(ans)
# Judge status: Wrong Answer
c = input()
print('vowel' if 'aeiou' in c else 'consonant')
# Judge status: Accepted
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
n, k = map(int, input().split())
ans = 0
for i in range(1, n+1):
    sumv = i
    cnt = 1
    while True:
        if sumv >= k: break
        sumv *= 2
        cnt /= 2
    ans += cnt
print(ans/n)
# Judge status: Wrong Answer
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

# import numpy as np
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, L = map(int, readline().split())
F = [L + i for i in range(N)]

ans = 1000
for i in itertools.combinations(F, N - 1):
    if abs(sum(F) - sum(i)) < ans:
        ans = sum(i)

print(ans)
# Judge status: Accepted
t = input()

t = t.replace('?','D')

print(t)
# Judge status: Wrong Answer
r, g, b = map(int, input().split())
if (r*100+g*10+b)%4:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
if input() in "753":
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,l=map(int, input().split())
    ll=list(range(l,l+n))
    moto=sum(ll)
    if ll[0]>0:
        print(moto-ll[0])
    elif ll[-1]<0:
        print(moto-ll[-1])
    else:
        print(moto)
resolve()
# Judge status: Wrong Answer
import sys
A,B = map(int,input().split())
if not ( 10000 <= A <= B <= 99999 ):
    sys.exit()

count = 0
for I in range(A,B+1):
    print(I)
    if str(I) == str(I)[::-1]:
        count += 1
print(count)
# Judge status: Accepted
n,m=map(int,input().split())
a=list(map(int,input().split()))
def gcd(a,b):
  while b:a,b=b,a%b
  return a
def lcm(a,b):return a*b//gcd(a,b)
l=a[0]//2
ll=a[0]
for i in range(1,n):
  if a[i]%2:odd=True
  else:even=True
  l=lcm(l,a[i]//2)
  ll=lcm(ll,a[i])
  if l>m:print(0);exit()
for i in range(n):
  if l%a[i]==0:print(0);exit()
print((m-l)//ll+1)
# Judge status: Accepted
A = input()
D = input()
if A[0] == D[2] and A[1] == D[1] and A[2] == D[0]:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
A,B,C=map(int,input().split())
K=int(input())
list=[A,B,C]

for i in range(K):
    if list[0]<list[1]<list[2]:
        break
    if list[1]>list[2]:
        list[2]=2*list[2]
    elif list[0]>list[1]:
        list[1]=2*list[1]
    
    
    


if list[0]<list[1]<list[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# Problem C - Multiple Gift

# input process
X, Y = map(int, input().split())

# initialization
current_num = X
count = 0

# count process
while current_num<=Y:
    count += 1
    current_num *= 2

print(count)
# Judge status: Accepted
n,a,b,c,d = map(int,input().split())
s = input()
if "##" in s[min(a,b)-1:max(c,d)]:
    print("No")
else:
    if d > c:
        print("Yes")
    else:
        for i in range(b-1,d):
            if s[i-1] == "." and s[i] == "." and s[i+1] == ".":
                print("Yes")
                break
        else:
            print("No")
# Judge status: Wrong Answer
def check(input_list):
    kawaiso = False
    a = input_list[0]
    b = input_list[1]
    c = input_list[2]

    if((a == b or a == c or b == c) and not(a == b and b == c)):
        kawaiso = True

    return kawaiso

if __name__ == '__main__':
    input_list = input().split()
            
    if check(input_list):
        print("yes")
    else:
        print("no")
# Judge status: Wrong Answer
n = int(input())

for i in range(1,10):
  r = n/i
  if len(str(r)) < 2 and r <= 9:
    print("Yes")
    exit()
    
print("No")
# Judge status: Accepted
# 099A

N = int(input())

if N < 1000:
    print('ABC')
else:
    print('ABD')
# Judge status: Wrong Answer
N = int(input())

ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
  st = str(input())
  if(st == 'AC'):
    ac += 1
  elif(st == 'WA'):
    wa += 1
  elif(st == 'TLE'):
    tle += 1
  else:
    re += 1

print('AC × {}'.format(ac))
print('WA × {}'.format(wa))
print('TLE × {}'.format(tle))
print('RE × {}'.format(re))
# Judge status: Wrong Answer
K = int(input())
S = str(input())

if len(S) <=K:
    print(S)
else:
    print(S[:K])
# Judge status: Wrong Answer
N, K = map(int, input().split())
X = list(map(int, input().split()))
ans = 10**19

for i in range(N-K+1):
    if X[i] >= 0:
        num = X[K+i-1]
    else:
        num = X[K+i-1] + abs(X[i]*2)
    if num < ans:
        ans = num
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()

for i in range(a + b + 1):
    if (i == a and s[i] != '-') or (i != a and s[i] == '-'):
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
A,B=list(map(int, input().split()))
if A<=8 and B<=8:
  print('Yay!')
else:
  print(':(')
# Judge status: Accepted
ab=input().rstrip().split(" ")
a=int(ab[0])
b=int(ab[1])
string=""
if a>b:
    for i in range(a):
        string=string+str(b)
elif a==b:
    for i in range(a):
        string=string+str(a)
elif a<b:
    for i in range(b):
        string=string+str(a)
print(string)
# Judge status: Accepted
s = input() #sys.stdin.readlineは最後が改行

n = len(s)
hn = (n-1)//2
hs = s[:hn]

for i in range(hn):
    if s[i] != s[-1-i]:
        print('No')
        exit()
    if hs[i] != hs[-1-i]:
        print('No')
        exit()

print('Yes')
# Judge status: Accepted
A, B, K = map(int, input().split())

ans = []

for i in range(1, max(A, B) + 1):
    if A % i == 0 and B % i == 0:
        ans.append(i)

print(ans[-K])
# Judge status: Accepted
def main():
    s = input()
    a=s[:2]
    b=s[2:]
    if (a=="00" or 12<int(a)<100) and (1<= int(b)<=12):
        print("YYMM")
    elif (1<= int(a)<=12) and (b=="00" or 12<int(b)<100):
        print("MMYY")
    elif ((1<= int(a)<=12) and (0<=int(b)<13) )or ((1<= int(b)<=12) and (0<=int(a)<13)):
        print("AMBIGUOUS")
    else:
        print("NA")
main()
# Judge status: Accepted
import sys
input=lambda: sys.stdin.readline().rstrip()
import collections
n,m=map(int,input().split())
edge=[[] for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)

Ans=[0]*n

Chk=[False]*n
Dist=[float("inf")]*n
Chk[0]=True
Dist[0]=0
S=collections.deque()
S.append(0)
while S:
  s=S.popleft()
  for g in edge[s]:
    if not Chk[g]:
      S.append(g)
      Chk[g]=True
      Ans[g]=s+1



print("Yes")
for i in range(1,n):
  print(Ans[i])
# Judge status: Accepted
import sys
# input = sys.stdin.readline
from itertools import accumulate

def main():
    N = int(input())
    S = input()
    
    east = accumulate([0] + list(S), lambda total, c: total + (1 if c == "E" else 0))
    next(east)
    east = list(east)

    west = accumulate([0] + list(S), lambda total, c: total + (1 if c == "W" else 0))
    next(west)
    west = list(west)

    east_max = east[-1]
    for i in range(N):
        e = east_max - east[i]
        w = 0 if i == 0 else west[i-1]
        yield e + w



print(min(main()))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**7)
mo=998244353
n=int(input())
dp=list(map(int,input().split()))#[0,0,0]
for i in range(1,n):
    a,b,c=list(map(int,input().split()))
    dp=[a+max(dp[1],dp[2]),b+max(dp[0],dp[2]),c+max(dp[0],dp[1])]
print(max(dp))
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
if K >= A:
    A, K = 0, K - A
else:
    A = A - K
    K = 0
# print(A, B, K)
if K >= 1:
    B, K = B - K, K - B

print(A, B)
# Judge status: Accepted
# -*- coding: utf-8 -*-
s = list(input())

#if len(set(s)) == 4 or (len(set(s)) == 2 and ('N' in s and 'S' in s) or ('W' in s and 'E' in s)):
#    print("Yes")
if len(set(s)) == 4:
    print("Yes")
elif len(set(s)) == 2 and 'N' in s and 'S' in s:
    print("Yes")
elif len(set(s)) == 2 and 'E' in s and 'W' in s:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import fractions
from functools import reduce

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_ls(num):
    return reduce(lcm, num, 1)


n = int(input())
ls = list(map(int, input().split()))

m = lcm_ls(ls)

ans = 0

for i in range(n):
    ans += m // ls[i]

print(ans % (10 ** 9 + 7))