peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  a,b = map(int,input().split())
  print(int((b-a) * (b-a+1)/2 - b))
  
if __name__ == '__main__':
  main()
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
ans = [0 for i in range(N)]
ans2 = []
for i in range(N):
    p = N - 1 - i
    if a[p] != sum(ans[p::p + 1]) % 2:
        ans[p] = 1
        ans2.append(str(p + 1))
print(sum(ans))
print(" ".join(ans2))
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 0
tmp = 100000

for i in range(N):
  if tmp > abs(A - (T - 0.006*H[i])):
        tmp = abs(A - (T - 0.006*H[i]))
        ans = i + 1
print(ans)
# Judge status: Wrong Answer
w, h, n=map(int,input().split())

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

w1 = 0
w2 = w
h1 = 0
h2 = h

for i in range(n):
    if(mat[i][2] == 1):
        w1 = mat[i][0]
    elif(mat[i][2] == 2):
        w2 = mat[i][0]
    elif(mat[i][2] == 3):
        h1 = mat[i][1]
    else:
        h2 = mat[i][1]
        
print((w2-w1)*(h2-h1) if w2 >= w1 and h2 >= h1 else 0)
# Judge status: Accepted
MOD=10**9+7
n, k = map(int, input().strip().split())
ans=0
for i in range(k,n+2):
    ans+=i*(n-i+1)+1
    ans%=MOD
print(ans)
# Judge status: Accepted
A,B,N =  list(map(int, input().split()))


if N < B-1:
    print(A*N//B)
else:
    print(A*(B-1)//B)
# Judge status: Wrong Answer
import math
a=int(input())
b_4 = math.ceil(a/4)
b_7 = math.ceil(a/7)

count =0
for i in range(b_4+1):
    for j in range(b_7+1):
        
        if (4*i+j*7) == a:
            count += 1

if count==1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, M = map(int, input().split())
d = dict()
A = list(map(int, input().split()))
for i in range(N):
	d[A[i]] = d.get(A[i], 0) + 1
for i in range(M):
	B, C = map(int, input().split())
	d[C] = d.get(C, 0) + B

ans = 0
keys = sorted(list(d.keys()), reverse = True)
for k in keys:
	kosuu = min(N, d.get(k))
	ans += k * kosuu
	N -= kosuu
	if N == 0:
		break
print(ans)
# Judge status: Wrong Answer
import re

x = input()
pattern = "R+"
pat = re.match(pattern, x)
if pat:
  print(len(pat.group()))
else:
  print(0)
# Judge status: Accepted
a,b=(int(x) for x in input().split())
if (a+b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
a,b,n=map(int,input().split())
print(b//n-a//n+(a%n==0))
# Judge status: Accepted
C=[0,0]
A=[0,0]
C[0]=list(input())
C[1]=list(input())
A[1]=[C[0][-1],C[0][-2],C[0][-3]]
A[0]=[C[1][-1],C[1][-2],C[1][-3]]
print('YES' if A==C else 'NO')
# Judge status: Wrong Answer
import math
l=[int(input()) for _ in range(5)]
l_min=[]
ans=0
for i in l:
    l_min.append(i%10)
for _ in range(4):
    ind=l_min.index(max(l_min))
    l_min.pop(ind)
    res=math.ceil(l.pop(ind)/10)*10
    ans+=res
print(ans+l[0])
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = read().rstrip().decode()

def solve(S):
    N = len(S)
    if N % 2 == 1:
        return False
    T = 'hi' * (N//2)
    return S == T

print('Yes' if solve(S) else 'No')
# Judge status: Accepted
e = int(input())
print(e*800 - (int(e/15)*200))
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())

dy = tx - sx
dx = ty - sy

ans = ''

ans += 'U' * dx
ans += 'R' * dy
ans += 'D' * dx
ans += 'L' * dy
ans += 'L'
ans += 'U' * (dx + 1)
ans += 'R' * (dy + 1)
ans += 'D'
ans += 'R'
ans += 'D' * (dx + 1)
ans += 'L' * (dy + 1)
ans += 'U'

print(ans)
# Judge status: Wrong Answer
import sys
N = int(input())
H = list(map(int, input().split()))
for i in range(N-1):
    if H[i]-1 >= H[i+1]:
        print("No")
        sys.exit()
        
print("Yes")
# Judge status: Wrong Answer
x, y = (int(i) for i in input().split())

if x == 2 or y == 2:
  print('No')
if x == 4 or  x == 6 or x == 9 or x == 11:
  if y == 4 or y == 6 or y == 9 or y == 11:
    print('Yes')
  else:
    print('No')
else:
  if y == 4 or y == 6 or y == 9 or y == 11:
    print('No')
  else:
    print('Yes')
# Judge status: Accepted
import itertools
from math import sqrt
def distance(a,b):
    return sqrt((a[0]-b[0])**2+(a[1]-b[1])**2)

N=int(input())
towns=[tuple(map(int,input().split())) for _ in range(N)]
dis_town=[[0]*N for _ in range(N)]
for i in range(N):
    for j in range(N):
        dis_town[i][j]=distance(towns[i],towns[j])
combs=list(itertools.permutations(range(N)))
total=0
for comb in combs:
    for i in range(N-1):
        total+=dis_town[comb[i]][comb[i+1]]

print(total/len(combs))
# Judge status: Wrong Answer
a=input()

if 'RR' in a:
    print("2")
elif 'R' in a:
    print("1")
elif 'RRR' in a:
    print('3')
else:
    print("0")
# Judge status: Accepted
#!/usr/bin/env python3
from collections import Counter
import sys
sys.setrecursionlimit(10**6)


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

c = Counter(a)

ans = 0
for i in sorted(c.keys()):
    if c[i] < i:
        ans += c[i]
    elif c[i] == i:
        continue
    elif c[i] > i:
        ans += c[i]-i
print(ans)
# Judge status: Accepted
d,n = map(int,input().split())
ans = 0
if n != 100:
  ans = 100**d * n
else:
  ans = 100**d * 101
print(ans)
# Judge status: Wrong Answer
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

if X >= Y:
  pass
else:
  X = Y
  Y = X
  
if X > 2 * Y:
  print(0)
  exit()
else:
  pass

cnt1 = 0

while X < 2 * Y:
  X = X - 1
  Y = Y - 2
  cnt1 += 1

if X != 2 *Y:
  print(0)
  exit()
else:
  pass

cnt2 = Y
ans = combinations_count((cnt1 + cnt2), cnt2) % (10 ** 9 + 7)
print(ans)
# Judge status: Accepted
x = int(input())

# print(x)

ans = 0

ans += x // 500 * 1000

ans += x % 500 // 5 *5

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split())) + [0]
m, s = 1000, 0
for i in range(n):
    if a[i] < a[i+1] and s == 0:
        s = m//a[i]
        m -= a[i]*s
    elif a[i] > a[i+1] and s:
        m += a[i]*s
        s = 0
    
print(m)
# Judge status: Wrong Answer
n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
for i in range(n):
    if a[i]<=b[i]:
        a[i]=b[i]

a=sorted(a)
b=sorted(b)
for i in range(n):
    if a[i]<=b[i]:
        a[i]=b[i]
        
if a==b:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=list(input())
    N=list(reversed(list(map(int,N))))+[0]
    ans=0
    for i in range(len(N)):
        if N[i]>=6 or (N[i]==5 and N[i+1]>=5):
            ans+=10-N[i]
            N[i+1]+=1
        else:
            ans+=N[i]
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
X = int(input())
if X >= 30: print("Yes")
else: print("Mp")
# Judge status: Accepted
a, b = map(int, input().split())
if a * b <= 0:
    print("Zero")
elif a > 0:
    print("Positive")
else:
    num = b - a + 1
    if num % 2 == 0:
        print("Positive")
    else:
        print("Negative")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
pumi=0
ff=0
cut=1
for i in range(0,N-1):
    if pumi==0:
        ff=0
    elif pumi==-1:
        ff=-1
    elif pumi==1:
        ff=1

    if A[i+1]>A[i]:
        pumi=1
    elif A[i+1]<A[i]:
        pumi=-1

    if pumi==-1 and ff==1:
        cut+=1
        pumi=0
    elif pumi==1 and ff==-1:
        cut+=1
        pumi=0
print(cut)
# Judge status: Wrong Answer
import numpy as np

N, K, Q = map(int, input().split()) 
score = np.array([0]*N)

def change_score(N ,A, score):
    score = score - np.array([1]*N)
    score[A-1] = score[A-1] + 1
    return score

for i in range(Q):
    A = int(input())
    score = change_score(N, A, score)
    print(score)
    f_score = score

for i in f_score:
    if i + K> 0:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
import sys
import math
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, d = map(int, input().split())
    print(math.ceil(n/(d*2)))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
K,X = input().split()

def main(K,X):
  if (K * 500) >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main(K,X)
# Judge status: Wrong Answer
N , K =map(int,input().split())
H = []
for i in range(N):
    H.append(input())
H =sorted(H)

ans = 1000000000
for j in range(N-K+1):
    ans=min(int(H[j+K-1])-int(H[j]),ans)

print(ans)
# Judge status: Wrong Answer
w = input()
while len(w) > 0:
    a = w[0]
    if w.count(a)%2 != 0:
        print("No")
        exit()
    w = w.replace(a,"")
    print(w)
print("Yes")
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = sum(map(int,input().split()))

print(N-A if N<=A else -1)
# Judge status: Wrong Answer

def main2():
    a, b, c, d = list(map(int, input().split()))

    sss = b//c - (a-1)//c
    ssss = b//d - (a-1)//d
    if d % c == 0:
        di = c
    elif c % d == 0:
        di = d
    elif ((d*c)/2) % c == 0 and ((d*c)/2) % d == 0:
        di = d*c//2
    else:
        di = c*d
    sssss = b // di - (a - 1) // di if di != 0 else 0
    print((b-a+1) - (sss+ssss-sssss))


if __name__ == '__main__':
    main2()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
four, two, none = 0, 0, 0
for i in range(n):
    if a[i] % 4 == 0:
        four += 1
    elif a[i] % 2 == 0:
        two += 1
    else:
        none += 1
if four >= none or (four == none-1 and two == 0):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math

n, m = map(int, input().split())
n_f = math.factorial(n)
m_f = math.factorial(m)
res = (n_f * m_f * 2) % 1000000007
if abs(n - m) >= 2:
    res = 0
print(res)
# Judge status: Wrong Answer
n = int(input())
ls_a = list(map(int, input().split()))
ls_b = list(map(int, input().split()))

ans = 0
res = 0

for i in range(n):
	ans += min(ls_a[i], res + ls_b[i])
	if res >= ls_a[i]:
		res == ls_b[i]
	else:
		res = max(res + ls_b[i] - ls_a[i], 0)

if res >= ls_a[n]:
	print(ans + ls_a[n])
elif 0 <= res < ls_a[n]:
	print(ans + res)
else:
	print(ans)
# Judge status: Accepted
a=input()
if a.islower()==True:
    print("a")
else:
    print("A")
# Judge status: Accepted
from fractions import gcd
A, B, C, D = [int(i) for i in input().split()]
lcm = C*D//gcd(C, D)
ans = (B-B//C-B//D+B//lcm-(A-A//C-A//D+A//lcm))
if A < B and A % C and A % D:
    ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
q = int(input())

A = [0] * 100001
for i in a:
  A[i] += 1

ans  = 0
for i in range(len(A)):
  ans += i * A[i]  

for n in range(q):
  b,c = list(map(int, input().split()))
  ans += (c * A[b]) - (b * A[b])
  A[c] += A[b]
  A[b] = 0
  print(ans)
# Judge status: Wrong Answer
import fractions

MOD = 1000000007
N = int(input())
A = list(map(int,input().split()))
#print(math.gcd(5,4))

LCM = A[0]
for i in range(0,N-1,1):
    LCM = LCM*A[i+1]//fractions.gcd(A[i+1],LCM)
B = [0 for i in range(0,N,1)]
for i in range(0,N,1):
    B[i]=LCM//A[i]

ans = 0
for i in range(0,N,1):
    ans = B[i] + ans

print(ans)
# Judge status: Accepted
#C
N, K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(N - K):
    if A[i] < A[i + K]:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
x = int(input())

if x == 7 or 5 or 3:
  print("YES")
  
else:
  print("NO")
# Judge status: Accepted
from math import ceil
n,k=map(int,input().split())
a=list(map(int,input().split()))
n-=1
k-=1
print(ceil(n/k))
# Judge status: Accepted
n=int(input())

for i in range(10**5):
    if i**2 > n:
        print((i-1)**2)
        break
# Judge status: Accepted
import math
a,b=map(int,input().split());print(math.ceil((a+b)/2))
# Judge status: Accepted
a = int(input())

A = a + a**2 + a**3

print(A)
# Judge status: Accepted
n, a, b = map(int, input().split())
sho = n//(a+b)
amari = n % (a+b)
print(sho*a+min(a, amari))
# Judge status: Wrong Answer
N=int(input())
P=[1]+list(map(int,input().split()))

ans=0
for i in range(1,N):
    if P[i]==i:
        if i+1!=P[i] or i==1:
            P[i+1],P[i]=P[i],P[i+1]
            ans+=1
        else:
            P[i-1],P[i]=P[i],P[i-1]
            ans+=1
print(ans)
# Judge status: Wrong Answer
def maxvolume (s): 

    maxvalue = 0

  

   

    i = 1

    for i in range(s - 1): 

        j = 1

          

        

        for j in range(s): 

              

            

            k = s - i - j 

              

           

            maxvalue = max(maxvalue, i * j * k) 

              

    return maxvalue 

s = 8

print(maxvolume(s))
# Judge status: Wrong Answer
n,k   = [int(i) for i in input().split()]
r,s,p = [int(i) for i in input().split()]
t = input()

ans = [0 for i in range(n)]
for i in range(n):
    w = t[i]
    if w=='r':
        ans[i] = p
    elif w=='s':
        ans[i] = r
    else:
        ans[i] = s
        
for i in range(k, n):
    if ans[i]==ans[i-k]:
        ans[i]=0
        
print(sum(ans))
# Judge status: Wrong Answer
import numpy as np


def check_bingo(A):
    for i in range(3):
        if np.all(A[i] == 0) or np.all(A[:, i] == 0):
            return 'Yes'
    if np.all(A[list(range(3)), list(range(3))] == 0):
        return 'Yes'

    return 'No'


def main():
    A = np.array([list(map(int, input().split())) for _ in range(3)])
    n = int(input())
    for i in range(n):
        b = int(input())
        A = np.where(A == b, 0, A)
    ans = check_bingo(A)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))


F=0
for i in range(1,N):
    if A[i]<A[i-1]:
        F+=A[i-1]-A[i]
print(F)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

q, h,s,d, = map(int, input().split())

n = int(input())
ans = 0

qqqq = q*4
hh = h*2

best1 = min(qqqq,hh,s)

if n ==1:
    print(best1)
    exit()

if d >= best1*2:
    print(n*best1)
    exit()


else:
    d_ = n//2
    n -= d_*2
    ans += d*d_
    ans += n*best1
    print(ans)
# Judge status: Wrong Answer
N,M = map(int,input().split())
AB =[list(map(int,input().split())) for i in range(N)]

AB = sorted(AB)
total=0
for i in range(N):
    if AB[i][1]>M:
        total = total + AB[i][0]*M
    else:
        total = total + AB[i][0]*AB[i][1]
        M = M - AB[i][1]
print(total)
# Judge status: Accepted
import sys
N, K = map(int,input().split())
A = [int(x) for x in input().split()]

def solve(N, K, A):
    """
    N <= 200,000
    """
    for i in range(K,N):
        prev = A[i-K]
        P = A[i]
        if prev >= P:
            print("No")
        else:
            print("Yes")

solve(N, K, A)
# Judge status: Accepted
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)
ans = 360 // (gcd(360, int(input())))
print(ans)
# Judge status: Accepted
n = int(input())
if n >= 30:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = input()
for a in range(len(s)):
  if s[a]=='A':
    break
s = s[::-1]
for z in range(len(s)):
  if s[z] =='Z':
    break
s= s[::-1]
print(len(s[a:-z]))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
for i in range(N):
	if sum(A[i+1:]) + B[N-1] <= sum(B[i:]):
		print(ans + A[i] + sum(B[i:]))
		exit()
	else:
		ans += A[i]
print(ans)
# Judge status: Accepted
a,b,c = map(int,input())
total = sum([a,b,c])
print(total)
# Judge status: Accepted
x,y=map(int,input().split())
if x>=y and x%y==0:
  print(-1)
elif x<y:
  print(x)
else:
  print(x*y-x)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
#-------------
a,b = map(int,input().split())
#-------------
x = (a+b)/2
y = x//1
mod = x%1
if mod == 0:
  print(y)
else:
  print(y+1)
# Judge status: Wrong Answer
A = int(input())
B = int(input())
C = int(input())
X = int(input())
i=0
for a in range(0,A+1):
  for b in range(0,B+1):
    for c in range(0,C+1):
      500*a + 100*b + 50*c == X
      i = i+1
print(i)
# 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):
  ans=max(ans,sum(a[:i+1])+sum(b[i:]))
print(ans)
# Judge status: Accepted
s = input()

res = [0 for i in range(2019)]
res[0] += 1

resten = 1
ressum = int(s[-1])
res[ressum] += 1

for i in range(2, len(s)+1):
    resten = (resten*10)%2019
    ressum = (int(s[-i])*resten + ressum)%2019
    res[ressum] += 1

ans = 0
for i in range(2019):
    ans += res[i]*(res[i]-1)//2
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
pyi=[[] for i in range(n)]
for i in range(m):
    p,y=map(int,input().split())
    pyi[p-1].append([y,i])
ans=[]
for i in range(n):
    pyi[i].sort()
    for j in range(len(pyi[i])):
        ans.append([(6-len(str(i+1)))*"0"+str(i+1)+(6-len(str(j+1)))*"0"+str(j+1),pyi[i][j][1]])
ans.sort(key=lambda x:x[1])
for i in range(m):
    print(ans[i][0])
# Judge status: Wrong Answer
#48
N = int(input())
h = list(map(int,input().split()))
move = 0
num = 0

for i in range(N-1):
    if h[i] >= h[i+1]:
        num += 1
    else:
        if move < num:
            move = num
            num = 0
            
if move < num:
    move = num
        
print(move)
# Judge status: Wrong Answer
S = list(str(input()))
for i, s in enumerate(S):
    if s == 'B':
        if i == 0:
            S[0] = ''
        else:
            S[i-1] = ''
            S[i] = ''

print(''.join(S))
# Judge status: Accepted
mod=10**9+7

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

d={}
for s in S:
    if s in d:
        d[s]+=1
    else:
        d[s]=1
ans=1
for D in d:
    ans*=d[D]+1
    ans%=mod
print((ans-1)%mod)
# Judge status: Wrong Answer
n = int(input())
l = len(str(n))
if l == 2:
  print(9)
elif l == 4:
  print(909)
elif l == 6:
  print(90909)
elif l == 1:
  print(n)
elif l == 3:
  print(n-90)
elif l == 5:
  print(n-8091)
# Judge status: Accepted
a=int(input())
if a<2:
  print(1)
elif 2<=a<4:
  print(2)
elif 4<=a<8:
  print(4)
elif 8<=a<16:
  print(8)
elif 16<=a<32:
  print(16)
elif 32<=a<64:
  print(32)
elif 64<=a:
  print(64)
# Judge status: Accepted
h, n = map(int, input().split())
a = list(map(int, input().split()))

if h <= sum(a):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
from itertools import permutations
def main():
    C = list(map( int, input().split()))
    S = [1, 2, 4,8]
    N = 4*int( input())
    ans = 10**20
    for P in permutations( range(4)):
        cost = 0
        left = N
        for i in P:
            cost += left//S[i]*C[i]
            left -= left//S[i]*S[i]
        if cost < ans:
            ans = cost
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = str(input())
S = [int(s[i]) for i in range(len(s))]
a = []
b = []
counta = 0
countb = 0
for i in range(len(S)):
    if i == 0 or i%2==0:
        a.append(0)
        b.append(1)
    else:
        a.append(1)
        b.append(0)
print(a)
print(b)
for i in range(len(S)):
    if S[i] != a[i]:
        counta += 1
    elif S[i] != b[i]:
        countb += 1
print(min(counta,countb))
# Judge status: Accepted
def main():
    S = map(int, input())

    a, b = 0, 1
    for s in S:
        a, b = min(a + s, b + 10 - s), min(a + (s + 1), b + 10 - (s + 1))

    print(a)


main()
# Judge status: Accepted
d = [1,3,5,7,8,10,12]
s = [4,6,9,11]
a = [2]

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

if (x in d and y in d) or (x in s and y in s) or (x in a and y in a):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, L = map(int, input().split())
taste = [0] * N

for i in range(N):
    taste[i] = L+i

tmp = taste[:]
for i in range(N):
    tmp[i] = abs(tmp[i])

ind = tmp.index(min(tmp))
print(sum(taste)-taste[ind])
# Judge status: Accepted
def main():
    a,b = (int(x) for x in input().split())
    print((a+b)%24)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

ans = 'APPROVED'
for i in range(N):
  if A[i] % 2 == 0 and A[i] % 3 != 0 and A[i] % 5 != 0:
    ans = 'DENIED'
    break
      
print(ans)
# Judge status: Wrong Answer
s=input()
t=input()
ans=len(t)
for i in range(len(s)):
    s1=s[i:len(t)]
    sum=len(t)
    for j in range(len(s1)):
        if t[j]==s1[j]:sum-=1
    ans=min(ans,sum)
print(ans)
# Judge status: Accepted
a,b,c = map(int, input().split())
 
if (a == b) and (b !=c):
	print('Yes')
elif (a == c) and (b !=c):
	print('Yes')
elif (b == c) and (a !=c):
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
a = input()
b = input()
c = input()
a = a.replace("a","")
b = b.replace("b","")
c = c.replace("c","")
turn = 'a'
for i in range(100):
	if turn == 'a':
		if int(len(a)) == 0:
			print("A")
			break
		else:
			turn = str(a[0])
			a = a[1:]
	if turn == 'b':
		if int(len(b)) == 0:
			print('B')
			break
		else:
			turn = str(b[0])
			b = b[1:]
	if turn == 'c':
		if int(len(c)) == 0:
			print('C')
			break
		else:
			turn = str(c[0])
			c = c[1:]
# Judge status: Wrong Answer
n = input()
N = list(str(n))
if 7 in N:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
k = int(input())
s = str(input())

if k < len(s):
    print(s[1:k],"...")
else:
    print(s)
# Judge status: Accepted
n, k = map(int,input().split())
alg = set([0,1,2,3,4,5,6,7,8,9])
numeros = set(map(int, input().split()))

def contem(num, numeros):
	
	for l in str(num):
		if int(l) in numeros:
			return False
	return True
	

target = n


while not contem(target,numeros):
	target += 1

print(target)
# Judge status: Accepted
N = int(input())
a= 2
b=1
for i in range(1,N+1):
    a,b = b,b+a
    #print('a=' +str(a)+' b=' +str(b))
print(a)
# Judge status: Accepted
from collections import deque
n=int(input())
a=deque([int(i) for i in input().split()])
b=deque()

if n%2==0:
    for i in range(n):
        if i % 2 == 0:
            b.append(a.popleft())
        else:
            b.appendleft(a.popleft())
else:
    for i in range(n):
        if i % 2 == 0:
            b.appendleft(a.popleft())
        else:
            b.append(a.popleft())
print(*b)
# Judge status: Accepted
N, L = [int(i) for i in input().split()]
S = sorted([input() for _ in range(N)])

print(*S, sep="")
# Judge status: Accepted
n = int(input())
for i in range(n, 1000):
    l = list(str(i))
    s = set(l)
    if len(s) == 1:
        print(i)
        exit()
# Judge status: Wrong Answer
N, K = map(int, input().split())

ans = max(N-K+1, 0) / N
i = 1
top = min(N, K-1)
while True:
    under = K // 2**i
    
    if under >= N:
        i += 1
        continue
    ans += (0.5**i / N) * (top - under)
    i += 1
    top = under
    
    if top == 0: break

print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
print("Yes" if (a+b+c) / max(a,b,c)==2 else "No")
# Judge status: Accepted
n = int(input())
cardList = list(map(int,input().split()))
a = 0
b = 0
cardList.sort(reverse=True)
while len(cardList) > 0:
    if len(cardList) > 0:
        a += cardList.pop(0)
    if len(cardList) > 0:
        b += cardList.pop(0)
print(a-b)
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
red = list(map(int,input().split()))
green = list(map(int,input().split()))
trans = list(map(int,input().split()))

red.sort(reverse=True)
green.sort(reverse=True)
trans.sort(reverse=True)
apple = red[:X] + green[:Y]
apple.sort()

j = 0
for i in range(X + Y):
    if apple[i] < trans[j]:
        apple[i] = trans[j]
        j = j + 1
        if j == C:
            break
    else:
        continue
print(sum(apple))
# Judge status: Accepted
def main():
    import sys
    readline = sys.stdin.buffer.readline

    a, b = map(int, readline().split())
    print(a*b if a < 10 and b < 10 else -1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import datetime
S=input()
dte = datetime.datetime.strptime(S, '%Y/%m/%d')
deh = datetime.datetime.strptime("2019/04/30",'%Y/%m/%d')
if dte<=deh:
  print("Heisei")
else:
  print("TBD")