peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import itertools
import math
import fractions
import functools
import copy

l, r = map(int, input().split())

if r - l > 2019:
    print(0)
    quit()

minimum = 10**10
for i in range(l, r+1):
    for j in range(l, r+1):
        if(i != j):
            minimum = min(minimum, (i*j) % 2019)

print(minimum)
# Judge status: Accepted
def main():
    s = input()
    t = input()
    len_s = len(s)
    len_t = len(t)

    min_count = len_t
    for i in range(len_s-len_t+1):
        count = len_t
        for j in range(len_t):
            if s[i+j] == t[j]:
                count -= 1
        if count < min_count:
            min_count = count
    return min_count


if __name__ == "__main__":
    print(main())
# Judge status: Accepted
tms=int(input())

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

strong_list.sort()

ans=sum(strong_list[tms::][::2])
print(ans)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

A = [10**5]*N

for i in range(N-1):
    A[i] = min(A[i], B[i])
    A[i+1] = min(A[i+1], B[i])

print(sum(A))
# Judge status: Accepted
O=input()
E=input()
ans=""
for i in range(len(E)):
  ans+=O[i]
  ans+=E[i]

if len(O)!=len(E):
  ans+=O[-1]
print(ans)
# Judge status: Wrong Answer
N, K = [int(x) for x in input().split(" ")]
A = [0 for i in range(N)]

for k in range(K):
    d_i = int(input())
    holder_list = [int(x) for x in input().split(" ")]

    for hi in holder_list:
        A[hi-1] += 1

count_non_holder = 0
for a in range(len(A)):
    if a == 0:
        count_non_holder += 1

print(count_non_holder)
# Judge status: Accepted
a,b,x = map(int,input().split())
ans = 0
if a%x==0:
    ans = (b-a)//x+1
else:
    c = (a//x+1)*x
    ans = (b-c)//x+1
print(ans)
# Judge status: Accepted
A,B,C=map(int, input().split())
K = int(input())

if A < B < C:
    print("Yes")
    exit()

for i in range(K):
    if A >= B:
        B *= 2
        continue
    if B >=C:
        C *= 2
        continue
if A < B < C:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,K = map(int, input().split())
line = list(map(int, input().split()))
# output = [1 for i in range(N-K+1)]
# print(output)
for i in range(N-K):
    if line[i] < line[i+K]:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
n,k = map(int,input().split())
coin = [0]*n
for i in range(min(k-1,n)):
    coin[i] += 1
while k > 1:
    k /= 2
    for i in range(min(int(k),n)):
        coin[i] += 1
ans = 0
for i in range(n):
    ans += (1/2)**coin[i]
print(ans / n)
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())

m = max(H, W)
if (N % m == 0):
    print(N // m)
else:
    print(N // m + 1)
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))
X.insert(0,0)
A = sorted(X[:])
a = A[N//2]
b = A[N//2+1]
for i in range(1,N+1):
    if X[i]>a:
        print(a)
    else:
        print(b)
# Judge status: Accepted
import numpy as np

s = input().strip()
t = 0
counts = np.array([0] * 2019)
counts[0] += 1
m = 1

for a  in reversed(s):
    t = (t + m * int(a)) % 2019
    counts[t] += 1
    m = m * 10 % 2019
    
print(int(np.sum(counts * (counts - 1) /2)))
# Judge status: Accepted
from fractions import gcd
A,B=map(int,input().split())
C=gcd(A,B)

if C==1:
   print(1)
else:
   count=1
   C_copy=C
   n=2
   while n**2<=C:
      flag=False
      while C_copy%n==0:
         C_copy//=n
         flag=True
      if flag:
         count+=1
         n=n+1 if n==2 else n+2
      else:
         n=n+1 if n==2 else n+2
   
   if C_copy!=1:
      count+=1

   print(count)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if a+b >= c:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
S = input().rstrip()
w = 0
b = 0
for i in range(len(S)):
    if i%2==0 and int(S[i])==0:
        w += 1
    elif  i%2==1 and int(S[i])==1:
        w += 1
    elif  i%2==0 and int(S[i])==1:
        b += 1
    elif  i%2==1 and int(S[i])==0:
        b += 1
print(min(w,b))
# Judge status: Wrong Answer
a=input()
b=input()
if a[0]==b[2] or a[2]==b[2] or a[2]==b[0]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N, K = [int(x) for x in input().split()]
R, S, P = [int(x) for x in input().split()]
T = input()


point = {'r':P, 's':R, 'p':S}
win = [False] * N
total = 0
for i in range(N):
    if i < K or T[i] != T[i - K] or win[i - K] == False:
        total += point[T[i]]
        win[i] = True

print(total)
# Judge status: Accepted
X = int(input())
d1 = X // 500
X -= d1 * 500
d2 = X // 5
print(d1 * 1000 + d2 * 5)
# Judge status: Wrong Answer
from collections import Counter
s = dict(Counter(input()))
a = [x for x in s.values()]
if len(a) == 1 and a[0] == 1:
    print("YES")
    exit()
if len(a) != 3 :
    print("NO")
    exit()
print("YES" if a[0] >= a[1] >= a[2] else "NO")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

def gcb(a, b):
    while b!=0:
        a,b=b,a%b
    return a

for i in range(n - 1):
    a[i + 1] = gcb(a[i], a[i + 1])
    
print(a[n - 1])
# Judge status: Accepted
n, T = map(int, input().split())

ans = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T >= t:
        flg = True
        ans = min(ans, c)
if flg: print(ans)
else: print('TLE')
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
ans = 0
mod = 10**9+7

for i in range(2, n+1):
    ans += i*(i-1)

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

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

ans = 0

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

ans = max(ans, a[0] + k - a[n - 1])

print(k - ans)
# Judge status: Accepted
N,M = map(int,input().split())
array = [10]*N
T_F = True

for i in range(M):
  s,c = map(int,input().split())
  if s>N or (array[s-1] != 10 and array[s-1] !=c) or (s == 1 and c == 0 and N != 1):
    T_F = False
    break
  else:
    array[s-1] = c

ans = 0
if T_F:
  for i in range(N):
    if array[i] == 10:
        array[i] = 0
    ans += array[i]*(10**(N-i-1))
  if array[0] or N == 1:
    print(ans)
  else:
    print(ans+10**(N-1))
else:
  print(-1)
# Judge status: Wrong Answer
s = list(input())
cnt = 0
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        cnt += 1
if cnt > 0 and cnt % 2 == 0:
    print(len(s)-cnt+1)
elif  cnt > 0 and cnt % 2 != 0:
    print(len(s)-cnt)
else:
    print(len(s))
# Judge status: Accepted
N =input()
ans = 0
for i in range(len(N)):
    ans += int(N[i])
    
if(N[0] == "1" and int(N)%10 == 0):
    print(ans*10)
else:
    print(ans)
# Judge status: Accepted
PQR=list(map(int,input().split()))
PQR.sort()
print(PQR[1]+PQR[0])
# Judge status: Wrong Answer
list=list(map(int, input().split()))
count=0
m=list[0]
for i in list:
    a=i
    if m >= a:
        count+=1
    m = a
print(count)
# Judge status: Accepted
A,B,C=map(int,input().split())
if C>=A and C<=B:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

m = max(l)
o = sum(l) - m

if m < o:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
## https://atcoder.jp/contests/abc125/tasks/abc125_d

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

dp = [[0] * 2 for i in range(N)]

dp[1][False] = N_List[0] + N_List[1]
dp[1][True] = (N_List[0] + N_List[1])*-1

for i in range(2,N):
    dp[i][False] = max(dp[i-1][True] + N_List[i],dp[i-1][False] + N_List[i])
    dp[i][True] = max(dp[i-1][True] + N_List[i-1]*2 + N_List[i]*-1 ,dp[i-1][False] + N_List[i]*-2 + N_List[i]*-1)

print(max(dp[N-1]))
# Judge status: Accepted
def main():
    from itertools import accumulate

    n, k, *ab = map(int, open(0).read().split())
    c = list(zip(ab[::2], ab[1::2]))
    c.sort(key=lambda x: x[0])
    count = 0
    for i, j in c:
        count += j
        if k <= count:
            print(i)
            break


if __name__ == '__main__':
    main()
# Judge status: Accepted
L, R = map(int, input().split())

ans = 10 ** 100
for i in range(L, R+1):
    if ans == 0: break
    for j in range(i+1, R+1):
        ans = min(ans, i * j % 2019)
        if ans == 0: break

print(ans)
# Judge status: Accepted
S=input()
A=S.count('a')
B=S.count('b')
C=S.count('c')
if abs(A-B)<=1 and abs(C-B)<=1 and abs(A-C)<=1:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
print((10000 - int(input())) % 1000)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
h = h[::-1]

for i in range(1, n):
    dh = h[i] - h[i - 1]
    if dh == 1:
        h[i] -= 1
    elif dh > 1:
        print('No')
        exit()

print('Yes')
# Judge status: Wrong Answer
s=input()
a=[]
for i in s:
    a.append(i)
if a[0]==a[1] and a[2]==a[3]:
    print('Yes')
elif a[0]==a[2] and a[1]==a[3]:
    print('Yes')
elif a[0]==a[3] and a[1]==a[2]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = []
for _ in range(N):
  Ai,Bi = map(int,input().split())
  A.append([Ai,Bi])
A.sort(key=lambda x: x[0],reverse=True)  
A.sort(key=lambda x: x[1],reverse=True)

sum_pay = 0
checked = [1]*N
j=0
for i in range(M):
  while A[j][0] > M-i or checked[j] == 0:
    j += 1
    if j == N:
      break
  if j == N:
    break     
      
  sum_pay += A[j][1]
  checked[j] = 0

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

m = str(int(s[0]) - 1) + (len(s) - 1) * "9" 
ans1 = 0
for i in range(len(m)):
    ans1 += int(m[i])

if s[-1] != "9":
    n = n - int(s[-1]) +1
    s = str(n)

ans2 = 0
for i in range(len(s)):
    ans2 += int(s[i])



print(max(ans1, ans2))
# Judge status: Accepted
S = input()
if S == "SUN":
  print(7)
if S == "MON":
  print(6)
if S == "TUE":
  print(5)
if S == "WED":
  print(4)
if S == "THU":
  print(3)
if S == "FRI":
  print(2)
if S == "SAT":
  print(1)
# Judge status: Wrong Answer
N,K=map(int,input().split())
A=list(map(int, input().split()))

def has_duplicates(seq):
    return len(seq) != len(set(seq))

c=[1]
while 1:
    if has_duplicates(c):
        break
    d=c[-1]-1
    c.append(A[d])
p=c.pop()
i=c.index(p)
c_=c[i:]
e=(K-i)%len(c_)
print(c_[e])
# Judge status: Accepted
X = str(input())
em = 0
Return = []
for spam in range(len(X)):
    if X[spam] == " ":
        Return.append(int(X[em:spam]))
        em = spam+1
Return.append(int(X[em:]))
x = 1
for a in Return:
    x = x * a

print(x)
# Judge status: Wrong Answer
A, B = map(int, input().split())

if A == B:
    print('Draw')
elif A > B != 1:
    print('Alice')
else:
    print('Bob')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
diff = [a - b for a, b in zip(A, B)]
diff.sort()
k = 0
for d in diff:
  if d < 0:
    if d % 2 == 0:
      k += -d // 2
    else:
      k += -(d+1) // 2
  elif d == 0:
    continue
  else:
    k -= d

print(['Yes', 'No'][k<0])
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
b=sorted(a)
c,d=b[n//2-1],b[n//2]
for i in a:
    print(d if i<=c else c)
# Judge status: Accepted
S = list(input())
A = ['A', 'C', 'G', 'T']
T = []
ans = 0
for e in S:
	if e in A:
		ans += 1
	else:
		T.append(ans)
		ans = 0
T.append(ans)
print(max(T))
# Judge status: Accepted
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
X = LI()
sort_X = sorted(X)
ans1,ans2 = sort_X[(N-1)//2],sort_X[N//2]
for x in X:
    if x>=ans2:
        print(ans1)
    else:
        print(ans2)
# Judge status: Accepted
N, Q = map(int, input().split())
S = input()

a = [0] * N
c = [False] * N
for i in range(1, N):
    if S[i - 1:i + 1] == "AC":
        a[i] = a[i - 1] + 1
        c[i] = True
    else:
        a[i] = a[i - 1]

for i in range(Q):
    l, r = map(int, input().split())
    if l - 1 == 0:
        print(a[r - 1])
    elif c[l - 1] is True:
        print(a[r - 1] - a[l - 1])
    else:
        print(a[r - 1] - a[l - 1])
# Judge status: Accepted
a,b,c,d=map(int,input().split())
l=max(a,c)
r=min(b,d)
if l>r:
    print(0)
else:
    print(r-l)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
flag = True
for i in range(n-1):
    if h[i] > h[i+1] + 1:
        flag = False
        break
    elif h[i] == h[i+1] + 1:
        h[i+1] += 1
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,x = map(int,input().split())
a = list(input().split())
ans = 0

if int(a[0]) > x:
    ans += int(a[0])-x
    a[0] = x
for i in range(n-1):
    c = int(a[i+1]) + int(a[i])
    if c > x:
        ans += c-x
        a[i+1] = int(a[i+1])-(c-x)
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
to = [[] for _ in range(N)]
ans = [-1] * N
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

from collections import deque

Q = deque([0])
ans[0] = -2

while Q:
    v = Q.popleft()
    for s in to[v]:
        if ans[s] == -1:
            ans[s] = v
            Q.append(s)
print("Yes")
print(*(a + 1 for a in ans[1:]), sep="\n")
# Judge status: Accepted
s=input()
t=input()
ans=0
for i in range(len(s)):
    if (s[i]!=t[i]):
        ans+=1

print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
sunuke = list()
cnt = 0
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    sunuke.extend(a)
for j in range(1, n + 1):
    if j not in sunuke:
        cnt += 1
print(cnt)
# Judge status: Accepted
n,m=map(int,input().split())
w=[1]*n
p=[0]*n
p[0]=1
for i in range(m):
    x,y=map(int,input().split())
    x-=1
    y-=1
    if p[x]:
        p[y]=1
    w[x]-=1
    w[y]+=1
    if w[x]==0:
        p[x]=0
print(sum(p))
# Judge status: Wrong Answer
N=int(input())

max=0
for i in range(N+2,0,-1):
  s=int(i**(0.5))
  if i==s**2:
    max=i
    break
print(max)
# Judge status: Wrong Answer
a = list(map(int, input().split()))
print(f"a[0] * a[1]")
# Judge status: Accepted
import math

def a():
    s=input()
    if s[-1] == 's':
        print(s+'es')
    else:
        print(s+'s')


def b():
    pass



def c():
    pass



def d():
    pass


a()
# b()
# c()
# d()
# Judge status: Accepted
a, b, m = map(int,input().split())
rei = list(map(int,input().split()))
den = list(map(int,input().split()))
ans = [min(rei) + min(den)]
for i in range(m):
    x,y,c = map(int,input().split())
    ans.append(rei[x-1] + den[y-1] - c)
    
print(min(ans))
# Judge status: Accepted
MOD = 10 ** 9 + 7
s = int(input())
dp = [0] * (s + 1)
dp[0] = 1
ans = 0
for i in range(s):
    tmp = 0
    for j in range(s + 1):
        tmp += dp[j]
        dp[j] += tmp - dp[j]
        dp[j] %= MOD
    if s - (i + 1) * 3 < 0:
        break
    ans += dp[s - (i + 1) * 3]
print(ans % MOD)
# Judge status: Accepted
N,K = (int(T) for T in input().split())
Ins = [[] for T in range(0,N)]
for TN in range(0,N):
    Ins[TN] = [int(T) for T in input().split()]
InsSort = sorted(Ins)
Total = 0
for TN in range(0,N):
    if Total<K<=Total+InsSort[TN][1]:
        print(InsSort[TN][0])
        break
    else:
        Total += InsSort[TN][1]
# Judge status: Accepted
from itertools import accumulate
import bisect

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

acc = list(accumulate(a))

#idx = bisect.bisect_left(acc,acc[-1]//2)
#print(idx)
result = []
for i in range(n):
    result.append(abs((acc[-1] - acc[i] ) - acc[i]))
print(min(result))
# Judge status: Wrong Answer
import numpy as np
import math
import scipy
import itertools

def solve():
    n, a, b = map(int, input().split())
    print(max(b*(n-1)-a*(n-1)+1, 0))
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
n = int(input())
a=((n//1000)+1)*1000-n
if a == 1000:
    print(0)
else:
    print(a)
# Judge status: Accepted
import  sys
x = int(input())

for i in range(1000):
    for j in range(-1000,1000):
        if((i**5) - (j**5) == x):
            print(i,j)
            sys.exit()
# Judge status: Accepted
H = int(input())

cnt = 1
ans = 1

if H == 1:
    ans = 1
else:
    while True:
        if H // 2 > 1:
            H //= 2
            ans += 2 ** cnt
            cnt += 1
        else:
            ans += 2 ** cnt
            break

print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
city=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    city[a-1]+=1
    city[b-1]+=1
for i in range(n):
    print(city[i])
# Judge status: Wrong Answer
S, T = list(map(str,input().split()))
print(S + T)
# Judge status: Accepted
a = int(input())
b = int(input())
s = [1, 2, 3]
s.remove(a)
s.remove(b)
print(s[0])
# Judge status: Wrong Answer
def main():
    s = input()
    if s[2]==s[3]:
        if s[3]!=s[4]:
            if s[4]==s[5]:
                print('Yes')
    else:
        print('No')

main()
# Judge status: Wrong Answer
def bitsearch(n, a, x):
  mincost = 10**10
  for b in range(2**n):
    bit = format(b, f"0{n}b")
    total = [sum([int(bit[i])*a[i][j] for i in range(n)]) for j in range(m+1)]
    if min(total[1:]) >= x:
      mincost = min(mincost, total[0])
  return mincost

n, m, x = map(int, input().split())
a = []
for i in range(n):
  line = list(map(int, input().split()))
  a.append(line)
print(bitsearch(n, a, x))
# Judge status: Accepted
d, n = [int(x) for x in input().split()]

x = 100 ** d

if n == 100:
    n = 101

ans = n * x
print(ans)
# Judge status: Wrong Answer
n =int(input())
a = map(int, input().split())
t = False
for i in a:
    if i%3 ==0 or i%5 == 0:
        t = True
    else:
        t = False
if t:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Wrong Answer
L = int(input())
print(L//3 ** 3)
# Judge status: Accepted
K, A, B = map(int, input().split())

ans = 1
if A >= B:
    ans += K
else:
    restk = K
    # A < B
    restk -= A - 1

    if restk <= 0:
        ans += K
    else:
        if restk > 1:
            ans = max(K+1, A + (restk // 2)*(B - A) + restk % 2)
        else:
            ans = A + 1
print(ans)
# Judge status: Accepted
S=input()
mae=int(S[:2])
ato=int(S[2:])

if (1<=mae<=12) and (1<=ato<=12):
  print('AMBIGUOUS')
elif (1<=mae<=12) and (not (1<=ato<=12)):
  print('MMYY')
elif (not (1<=mae<=12)) and (1<=ato<=12):
  print('YYMM')
else:
  print('NA')
# Judge status: Wrong Answer
a, b = map(int, input().split())
i = 1
for n in range(1, a):
    for m in range(1, b):
        if n == m:
            i += 1
print(int(i))
# Judge status: Accepted
from itertools import combinations_with_replacement as comp_rplc

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

req = [list(map(int, input().split())) for _ in range(q)]

ans = 0

for seq in comp_rplc(range(1, m + 1), n):
  score = 0
  for a, b, c, d in req:
    if seq[b - 1] - seq[a - 1] == c:
      score += d
    
  ans = max(ans, score)

print(ans)
# Judge status: Accepted
n=int(input())
ans=float("INF")
for i in range(n+1):
  d=0
  temp=i
  while (temp>0):
    d+=temp%6
    temp//=6
  temp=n-i
  while(temp>0):
    d+=temp%9
    temp//=9
  ans=min(d,ans)
print(ans)
# Judge status: Accepted
c=input()
if c in 'aiueo':
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
xs = map(int, input().split())

print(list(xs).index(0) + 1)
# Judge status: Accepted
S = input()
T = input()
dic_S = {}
dic_T = {}
for i in range(len(S)):
    if S[i] not in dic_S:
        dic_S[S[i]] = T[i]
    elif dic_S[S[i]] != T[i]:
        print('No')
        exit()

    if T[i] not in dic_T:
        dic_T[T[i]] = S[i]
    elif dic_T[T[i]] != S[i]:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
from sys import exit
 
N = int(input())
h = list(map(int,input().split()))
 
pre = 0
for i in range(N-1):
    if h[i] <= h[i+1]:
        pre = h[i]
    else:
        if h[i]-1 <= h[i+1]:
            if pre > h[i]-1:
                print("No")
                exit(0)
            else:
                pre = h[i]-1
        else:
            print("No")
            exit(0)

print("Yes")
# Judge status: Accepted
import bisect
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
total=0
for j in range(N):
    b=B[j]
    p_a=bisect.bisect_left(A,b)
    p_b=bisect.bisect_right(C,b)
    total+=p_a*(N-p_b)
print(total)
# Judge status: Accepted
n , m = map(int , input().split())
ans = []
total = 0
for i in range(n):
  a = list(map(int , input().split()))
  ans.append(a)
ans = sorted(ans, key=lambda x:x[0])
j = 0
while m > 0:
  small = min(ans[j][1] , m)
  total += ans[j][0] * small
  m -= small
  j += 1
print(total)
# Judge status: Accepted
A, B, C = map(int,input().split())

if B %2 != 0:
    print(0)
    exit()
if A == B == C:
    print(-1)
    exit()

x = B/2
cnt = 0
while A % 2 == 0 and C % 2 == 0:
    tmp_a = A
    tmp_c = C
    A = tmp_c/2 + x
    C = tmp_a/2 + x
    cnt += 1
print(cnt)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
x = 1
if 0 in a:
    x = 0
else:
    for i in range(n):
        if x != -1:
            x = x * a[i]
        if x > 10 ** 18:
            x = -1
print(x)
# Judge status: Accepted
N = int(input())
l = list(map(int,input().split()))
m = {0:0,1:abs(l[1]-l[0])}
for i in range(2,N):
    m[i] = min(m[i-1]+abs(l[i]-l[i-1]),m[i-2]+abs(l[i]-l[i-2]))
print (m[N-1])
# Judge status: Accepted
import bisect
n = int(input())
a = sorted(list(map(int,input().split())))
ans = 0
mini = float('inf')
for i in range(n):
    if mini > abs(a[i]-a[n-1]/2):
        ans = i
        mini = abs(a[i]-a[n-1]/2)
print(a[n-1],a[ans])
# Judge status: Wrong Answer

C1 =str(input())
C2 =str(input())

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('Yes')

else:
    print('No')
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())
price = A*X + B*Y
tmp = 0
for i in range(1, int(1 + 10e5)):
    tmp = 2*C*i + max(0, X-i)*A + max(0, Y-i)*B
    price = min(price, tmp)
print(price)
# Judge status: Accepted
def update_queue(n, queue):
    out = queue[n]
    mod10 = out % 10
    if mod10 != 0:
        queue.append(10 * out + mod10 - 1)
    queue.append(10 * out + mod10)
    if mod10 != 9:
        queue.append(10 * out + mod10 + 1)

    return out, queue

N = int(input())
Q = [1,2,3,4,5,6,7,8,9]

for i in range(N):
    out, Q = update_queue(i, Q)

print(out)
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))
t=0
a.sort()
for i in range(len(a)):
  if i%2==0:
    t+=a[n-i-1]
  else:
    t-=a[n-i-1]
print(t)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
#a b
#c d

if b>=c and d>=a:
    print((min(b,d)-max(a,c)))
else:
    print(0)
# Judge status: Accepted
if(2 == len(set(input().split()))):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math

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

rev = 10**9+7

if n-m==0:
    ans = 2 * math.factorial(n) * math.factorial(m)
elif (abs(n-m)==1):
    ans = 1 * math.factorial(n) * math.factorial(m)
else:
    ans = 0
print(ans%rev)
# Judge status: Accepted
x=int(input())
import math
K=360//math.gcd(x,360)
print(K)
# Judge status: Accepted
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = int(input())
if s in [3,5,7]: print("YES")
else: print("NO")
# Judge status: Wrong Answer
# C - Subarray Sum
def main():
    N, K, S = map(int, input().split())
    res = [S] * K + [1 if S == 10 ** 9 else S + 1] * (N - S)
    print(*res)


if __name__ == "__main__":
    main()
# Judge status: Accepted
S=["Sunny","Cloudy","Rainy"]
s=input()
if s=="Rainy":
    print("Sunny")

else:
    print(S[S.index(s)+1])
# Judge status: Accepted
H, W = map(int, input().split())
from math import ceil
 
if H == 1 or W == 1:
  print(1)
else:
  print(ceil(H*W/2))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

from collections import Counter
ca = Counter(a)

for i in range(1, n+1):
    print(ca[i] if i in ca else 0)
# Judge status: Wrong Answer
S=sorted(input())
T=sorted(input())
print("Yes" if S==T else "No")
# Judge status: Accepted
N = int(input())
print(((10**N) - (2 * (9**N) - (8**N))) % ((10**9) + 7))
# Judge status: Wrong Answer
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

i = 0
for s in range(n+m):
    if i>k:
        if a[0]>=b[0]:
            i = i + a[0]
            del a[0]
        else:
            i = i + b[0]
            del a[0]
    else:
        print(s)