peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())

MOD_CONST = 10 ** 9 + 7

if N <= 2:
    print(0)
    exit()

res = [1] * N
res[0] = res[1] = 0

for i in range(5, N):
    res[i] = res[i - 4] + res[i - 3] + res[i - 2]

print(res[N-1] % MOD_CONST)
# Judge status: Accepted
def resolve():
    n = int(input())
    dict = {}
    s = [",".join(sorted(input())) for _ in range(n)]
    count = 0
    for i in range(n):
        if s[i] in dict:
            count += dict[s[i]]
            dict[s[i]] += 1
        else:
            dict[s[i]] =1

    print(count)
resolve()
# Judge status: Wrong Answer
s,t = input().split()
a,b = map(int,input().split())
j = input()
if s == j or t == j:
  print(a+b-1)
else:
  print(a+b)
# Judge status: Accepted
N, M = map(int, input().split())

abl1 = set()
abl2 = set()
for _ in range(M):
    ab = list(map(int,input().split()))
    if ab[0] == 1:
        abl1.add(ab[1])
    elif ab[1] == N:
        abl2.add(ab[0])


for i in abl1:
   if i in abl2:
       print("POSSIBLE")
       exit()
print("IMPOSSIBLE")
# Judge status: Wrong Answer
N = input()
A = input().split()

if len(set(A)) == N :
    print('YES')
else:
    print('NO')
# Judge status: Accepted
a, b = map(int, input().split())
if a < 0 and b < 0:
    if abs(b-a)%2 == 0: 
        print('Negative')
    else:
        print('Positive')
elif a <= 0 and b >=0:
    print('Zero')
else:
    print('Positive')
# Judge status: Accepted
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-03-14 21:31:08 +0900
# LastModified: 2020-03-16 13:10:13 +0900
#


import os
import sys
import math

def main():
    a,b,c = map(int,input().split())
    if 4*a*b<(c-a-b)**2 and c-a-b>0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
s=input()
if s.count('R')==3:
  print(3)
elif s[0]==s[1]=='R' or s[1]==s[2]=='R':
  print(2)
elif s.count('R')!=0:
  print(1)
else:
  print(0)
# Judge status: Accepted
w,a,b = map(int,input().split())

if a < b:
    print(max(0,b-a-w))
else:
    print(max(0,a-b-w))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
t=a+b+c
k=0
k|=0 if t-a in [a,b,c] else 1
k|=0 if t-b in [a,b,c] else 1
k|=0 if t-c in [a,b,c] else 1
print('YNeos'[k::2])
# Judge status: Wrong Answer
import math
a, b, c = map(int, input().split())

if a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
    print(0)
else:
    print(abs(a * b * (c // 2) - (a * b * (math.ceil(c / 2)))))
# Judge status: Accepted
a,b,k=map(int,input().split())
a-=k
if a<0:
    b+=a
print(max(0,a),max(0,b))
# Judge status: Accepted
n = int(input())

s = 0
ans = []
for i in range(1, n+1):
   s += i
   ans.append(i)
   if s >= n:
       if s > n:
           ans.remove(s-n)
       break

for x in ans:
    print(x)
# Judge status: Accepted
def main():
    h, n = map(int, input().split())
    magic_list = []

    for _ in range(n):
        a, b = map(int, input().split())
        magic_list.append((a, b))

    ans = solve(h, magic_list)
    print(ans)


def solve(h, magic_list):
    # 1-origin
    max_attack = max(magic_list)[0]
    dp = [0] * (h + max_attack)

    # time O(HN)
    for hp in range(1, h + 1):
        dp[hp] = min(dp[hp - attack] + mp for attack, mp in magic_list)

    return dp[h]


main()
# Judge status: Accepted
X = int(input())

happy = 0
happy += X // 500 * 1000
X = X % 500
happy += X //5 * 5

print(happy)
# Judge status: Accepted
S=input()
s=""
s1=""
s2=""
for i in range(len(S)-1):
    s=S[:len(S)-i-1]
    if (len(s)%2==0):
        s1=s[:int(len(s)/2)]
        s2=s[int((len(s)+1)/2):]
        if s1==s2:
            print(len(s))
            break
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a=int(input())
b=int(input())
h=int(input())
print((a+b)*h//2)
# Judge status: Accepted
n,m=map(int,input().split())
ans=[0 for _ in range(n+1)]
cnt=[1 for _ in range(n+1)]
ans[1]=1
for i in range(m):
  a,b=map(int,input().split())
  if ans[a]==1:
    ans[b]=1
    if cnt[a]==1:
      ans[a]=0
  cnt[a]-=1
  cnt[b]+=1
print(sum(ans))
# Judge status: Wrong Answer
n, m = map(int, input().split())

cnt = [0]*30
for i in range(n):
    l = list(map(int, input().split()))
    for j in range(1, l[0]+1):
        cnt[l[j]-1] += 1
print(cnt)
ans = 0
for i in cnt:
    if i == n:
        ans += 1

print(ans)
# Judge status: Wrong Answer
N, x = map(int, input().split())
A = [int(i) for i in input().split()]

ans = 0
for i in range(1, N):
    if A[i-1]+A[i] > x:
        e = A[i-1]+A[i]-x
        ans += e
        A[i] -= e
print(ans)
# Judge status: Accepted
def main():
    n,k = map(int, input().split())
    X = list(map(int, input().split()))

    tmp = []
    for i in range(n-k+1):
        l = X[i]
        r = X[i+k-1]
        tmp.append(abs(l)+abs(r-l))
        tmp.append(abs(r)+abs(r-l))
    print(min(tmp))


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

ans = n % k
s = n // 2
if s >= ans:
    print(ans)
else:
    print(abs(ans - s))
# Judge status: Accepted
#abc121_c
N, M = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]
AB= sorted(AB,key=lambda x:x[0])
ans = 0
for yen,num in AB:
    if num < M:
        ans += num*yen
        M-=num
    else:
        ans += M*yen
        break
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

import math

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

ans=0
for i in range(n-1):
    for j in range(i+1,n):
        diff=0
        for k in range(d):
            diff+=(x[i][k]-x[j][k])**2
        if math.sqrt(diff).is_integer():
            ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
As = list(map(int, input().split()))

al = 0
for a in As:
  al ^= a
  
rlt = []
for a in As:
  tmp = al ^ a
  rlt.append(tmp)

print(" ".join(map(str, rlt)))
# Judge status: Wrong Answer
import sys
n = int(input())
s = []
p = []
for i in range(n):
    s.append(input().split())

ls = sorted(s)
ls.sort(key=lambda x: x[1],reverse=True)
ls.sort(key=lambda x: x[0])

for i in range(n):
    print(s.index(ls[i])+1)
# Judge status: Accepted
S = int(input())
i = 0
ans = 0
mod = 10 ** 9 + 7
    
def comb(n, k):
  de = 1
  nu = 1
  for i in range(k):
    de *= (n - i) % mod
    nu *= (i + 1) % mod
  nu = pow(nu, -1, mod)
  return de * nu
  
while 1:
  S -= 3
  if S <= 0:
    if S == 0:
      ans += 1
    print(ans)
    exit()
  ans += comb(S+i, i)
  ans = ans % mod
  i += 1
# Judge status: Accepted
s = int(input())
v = 10**9
x = (v-s%v)%v
y = (s+x)//v
print(0,0,10**9,1,x, y)
# Judge status: Accepted
l = int(input())
a = l**3/27
print(a)
# Judge status: Accepted
A,B = list(map(int,input().split()))
C = B - A
if C % (A-1) == 0:
  print(C//(A-1)+1)
else:
  print(C//(A-1)+2)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
dp=[0]*n
for i in range(n):
  dp[i]=a[i]-i
dp.sort()
ans=0
for j in range(n):
  ans+=abs(dp[j]-dp[n//2])
print(ans)
# Judge status: Accepted
import math

N, D = map(int, input().split())
XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append([x, y])
ans = 0
for xy in XY:
    x = xy[0]
    y = xy[1]
    d = math.sqrt(x**2 + y**2)
    if d <= D:
        ans += 1
print(ans)
# Judge status: Accepted
from collections import Counter

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

c = Counter(A)
for i in range(N):
    if K - (Q - c[i+1]) > 0:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
# B
a = list(map(int, input().split()))
k = int(input())

a.sort(reverse=True)
a[0] = a[0]*2*k

print(sum(a))
# Judge status: Accepted
a,b,c=sorted(map(int,input().split()))
ans=0
if a==b==c:
  ans=0
else:
  ans+=c-b
  if (b-a)%2==0:
    ans+=(b-a)//2
  else:
    ans+=(b-a+3)//2
print(ans)
# Judge status: Accepted
#ABC064

r,g,b = map(int,input().split())
k = 100*r + 10*g + b
if k % 4 == 0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
# C - gacha

n = int(input())
s = []
c = 0

for i in range(n):
    s.append(input())

s.sort()

for j in range(n-1):
    if s[j] != s[j+1]:
        c += 1


print(c)
# Judge status: Accepted
from sys import stdin


def main():
    n = int(stdin.readline())
    a = [int(stdin.readline()) for _ in range(n)]
    l = {}
    for ai in a:
        if ai not in l:
            l[ai] = 1
        else:
            l[ai] = l[ai] + 1
    ans = 0
    for key in l:
        if l[key] % 2 == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
List_S = [input() for i in range(N)]
List_S.sort()
List_S.append(-1)

result = []
count_list = []
count = 1
for i in range(N):
    if List_S[i] == List_S[i + 1]:
        count += 1
    else:
        result.append(List_S[i])
        count_list.append(count)
        count = 1

ma = max(count_list)

for i in range(len(result)):
    if count_list[i] == ma:
        print(result[i])
# Judge status: Accepted
P,Q,R=map(int,input().split())
print(min(P+Q,P+R,Q+R))
# Judge status: Wrong Answer
import sys

n = int(input())
a = [0] + [int(sys.stdin.readline()) for _ in range(n)]

button = 1
count = 0

for _ in range(n + 1):
    if button == 2:
        print(count)
        break
    button = a[button]
    count += 1

if count == n:
    print(-1)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))

c_4=0
even=0
odd=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    even+=1
  else:
    odd+=1
  
if even==0 and odd-1 <= c_4:
  ans="Yes"
else:
  ans="No"
  
if even>0 and odd <= c_4:
  ans="Yes"
else:
  "No"

print(ans)
# Judge status: Accepted
k,x= map(int,input().split())
min = x-k+1
max= x+k-1
ans = []
for i in range(min,max+1):
  ans.append(i)
  
print(*ans)
# Judge status: Accepted
l,r=map(int,input().split())
if r-l<2019:
    l=l
    r=r
else:
    l=l
    r=l+2019
ans=2019
for i in range(l,r):
    for j in range(i+1,r+1):
        if (i*j)%2019<ans:
            ans=(i*j)%2019
print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())

ans = (a + b) // 2
print(ans)
# Judge status: Wrong Answer
#!/usr/bin/python

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

d1 = input_data[0]
d2 = input_data[1]
d3 = input_data[2]
total = 0

d4 = int(d2 / d1)
if d4 > d3:
    total = d3

print(total)
# Judge status: Accepted
n=int(input())

for k in range(n):
    s=input()
    tmp=[0]*26
    for i in range(len(s)):
        tmp[ord(s[i])-ord("a")]+=1

    if k==0: ans=tmp 
    else:
        for i in range(26):
            ans[i]=min(ans[i],tmp[i])

p=ord("a")
for i in range(26):
    for _ in range(ans[i]):
        print(chr(p+i),end="")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(max((b // a),c))
# Judge status: Accepted
n=int(input())
print((n * (n-1)) // 2 )
# Judge status: Accepted
N, M = map(int, input().split())
max_L = 0
min_R = 10**5
for _ in range(M):
  L, R = map(int, input().split())
  max_L = max(max_L, L)
  min_R = min(min_R, R)
print(len(list(range(max_L, min_R+1))))
# Judge status: Wrong Answer
a, b, x = map(int, input().split())
ans = 0
A = a%x
B = (b-a)%x
if A<=B:
  ans += 1
ans += (b-a)//x
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
if k > n:
    print(0)
    exit()
total = sum(h[0: n - k])
print(total)
# Judge status: Accepted
N, M = map(int, input().split())
SC = [list(map(int, input().split())) for _ in range(M)]

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

for i in range(start, 10 ** N):
    flag = 1
    si = str(i)
    for s, c in SC:
        if si[s - 1] != str(c):
            flag = 0
            break
    if flag:
        print(i)
        exit()
print(-1)
# Judge status: Wrong Answer
a,b,c,k = map(int,input().split())

x = abs(a-b)
if x > 10**18:
    print('Unfair')
else:
    if a <= b:
        if k % 2== 0:
            print(a-b)
        else:
            print(abs(a-b))
    else:
        if k % 2== 0:
            print(abs(a - b))
        else:
            print(a - b)
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0
for i in range(1, n+1):
    double = 0
    while True:
        if i >= k:
            break
        i *= 2
        double += 1
    ans += 0.5 ** double / n
print(ans)
# Judge status: Accepted
s=str(input())

lis=[0]*3

lis[0]=s.count("a")
lis[1]=s.count("b")
lis[2]=s.count("c")

n=len(s)//3

ans="YES"

for i in lis:
  if n<=i<=n+1:
    continue
  else:
    ans="NO"
    
print(ans)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
diff_x = tx-sx
diff_y = ty-sy
ans = []
for i in range(diff_x):
    ans.append("R")
for j in range(diff_y):
    ans.append("U")
for i in range(diff_x):
    ans.append("L")
for j in range(diff_y):
    ans.append("D")
ans.append("D")
for i in range(diff_x+1):
    ans.append("R")
for j in range(diff_y+1):
    ans.append("U")
ans.append("L")
ans.append("U")
for i in range(diff_x+1):
    ans.append("L")
for j in range(diff_y+1):
    ans.append("D")
ans.append("R")
print("".join(ans))
# Judge status: Accepted
N = int(input())

dict = {}
for i in range(N):
	item = input()
	if item in dict.keys():
		dict[item] += 1
	else:
		dict[item] = 1

print(len(dict))
# Judge status: Wrong Answer
import math
n = int(input())
print(int(math.ceil(360/n)))
# Judge status: Accepted
N = int(input())
brick = list(map(int,input().split()))

def Break(n, lst):
  counter = 0
  cur = 1
  for i in range(len(lst)):
    if lst[i] == cur:
      cur += 1
    else:
      counter += 1
  if cur == 1:
    return -1
  return counter

print(Break(N, brick))
# Judge status: Accepted
s = input()
if len(s) %2 !=0:
  print("No")
else:
  c =0
  for i in range(len(s)//2):
    hi = s[2*i:2*i+2]
    if hi == "hi":
      pass
    else:
      c = 1
      break
  if c ==0:
    print("Yes")
    
  else:
    print("No")
# Judge status: Accepted
x,n = list(map(int,input().split()))
p = list(map(int,input().split()))

ans=1000
for i in range(-105,102):
    if i in p:
        continue
    if abs(x-ans)>abs(i-x):
        ans=i
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

A.sort(reverse=True)

a = min(A[0], A[1])
ans = A[0]
idx = 1
c = 1

while c <= N-1:
    if(c == N-1):
        break
    if(c == N-2):
        ans += a
        break
        
    ans += a*2
    c += 2

    idx += 1
    a = min(A[idx], A[idx-1])
         
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

n,x,t=map(int,input().split())
print(t*(-(-n//x)))
# Judge status: Accepted
import math

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

digit = math.log(n, k)

if digit.is_integer():
    print(int(digit)+1)
else:
    print(math.ceil(digit))
# Judge status: Accepted
a,b,c=map(int,input().split())
print(a+b+c+max(a,b,c)*9)
# Judge status: Accepted
N,M,Q=map(int,input().split())

from itertools import combinations_with_replacement
A=[0]*N
conditions = []

for i in range(Q):
    con =list(map(int,input().split()))
    conditions.append(con)

c = combinations_with_replacement(range(1,M+1),N)

total =0
for seq in c:
    total_tmp=0
    for q in conditions:
        if seq[q[1]-1] - seq[q[0]-1] == q[2]:
            total_tmp += q[3]

    total = max(total,total_tmp )

print(total)
# Judge status: Wrong Answer
A = list(map(int,input().split()))
sm = 0
now = A[0]
for num in A:
    if num < now:
        sm += now-num
    elif num > now:
        now = num
print(sm)
# Judge status: Accepted
S=input()
if S=='ABC':
  print('ARC')
else:
  print('ABC')
# Judge status: Accepted
n,k = map(int,input().split())
lst = [list(map(int,input().split())) for i in range(n)]
lst.sort()

counter = 0
for i in range(n):
    counter += lst[i][1]
    if counter>=k:
        print(lst[i][0])
        break
# Judge status: Accepted
s = input()
words = set()
ans = 'yes'
for c in s:
    if c in words:
        ans = 'no'
        break
    words.add(c)
print(ans)
# Judge status: Wrong Answer
n,k = map(int,input().split())
A = list(map(int,input().split()))

if len(set(A))<=k:
    print(0)
else:
    d = {i:0 for i in set(A)}
    for a in A:
        d[a] += 1
    ans = list(d.values())
    print(sum(ans[k:]))
# Judge status: Accepted
x=int(input())
c=0
y,z,d=int(input()),int(input()),int(input())
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            f=500*i+100*j+50*k
            if(f==d):
                c+=1
print(c)
# Judge status: Accepted
s = list(input())

if(s[-1] == "s"):
    s.append("es")
else:
    s.append("s")
for i in s:
    print(i,end="")
# Judge status: Wrong Answer
s = list(input())
t = list(input())

s.sort(reverse=True)
t.sort(reverse=True)

s_len = len(s)
t_len = len(t)

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
equal = True
for i in range(short):
    if(s[i] < t[i]):
        flag = True
        break
    elif(s[i] == t[i] and equal == True):
        continue
    else:
        equal = False

else:
    if(s_len < t_len and equal == True):
        flag = True

if(s < t or flag):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    A, B, K = map(int, input().split())
    diff = A - K
    if diff < 0:
        print(0, B + diff)
    else:
        print(diff, B)


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import Counter

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

c = Counter(A)
total = sum(A)

Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    v = c.get(B)
    if v:
        c[B] = 0
        c[C] += v
        total += (C-B) * v

    print(total)
# Judge status: Accepted
N, K = map(int, input().split())
D = set(list(input().split()))

while True:
    if set(list(str(N))) & D:
        N += 1
    else:
        print(N)
        exit()
# Judge status: Wrong Answer
A, B, C = map(int, input().split())

for i in range(1, 110):
  if (B * i + C) % A == 0:
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
t,v,w=sum(a),1,1
for q in a:
  w=min(2*(w-q),t:=t-q);(v:=v+w)
  if w<0:print(-1);exit()
print(v)
# Judge status: Wrong Answer
n = int(input())

lst = list(map(int,str(n)))

if set(lst[1:]) == {9}:
    print(lst[0] + 9*(len(lst)-1))
else:
    print((lst[0]-1) + 9*(len(lst)-1))
# Judge status: Accepted
s = input()
back = ""
q = int(input())
rev = False
for i in range(q):
    inpt = input().split( )
    if len(inpt)>1:
        fi,ci = inpt[1],inpt[2]
        if not ((fi == "1") ^ rev):
            s += ci
        else:
            back += ci
    else:
        rev = not rev
back = back[::-1]
ans = back+s
if not rev:
    print(ans)
else:
    ans = ans[::-1]
    print(ans)
# Judge status: Wrong Answer
N = int(input())
for i in range(1,10):
    for j in range(1,10):
        ij = i * j
    if(N == i*j):
        print("Yes")
        break
if(N > 81):
    print("No")
# Judge status: Accepted
# 05

s = input()
x = 0
y = 0
for i in s:
    if i == 'S':
        y -= 1
    else:
        y += 1
    #print(x, y)
    x = max(x, y)
    
print(x*2)
# Judge status: Accepted
import heapq

N, M = map(int, input().split())

AB = []

for i in range(N):
    A, B = map(int, input().split())
    AB.append([A, B])

AB.sort(reverse=True)

q = []
cnt = 0
for i in range(1, M+1):
    while len(AB) > 0 and AB[-1][0] <= i:
        tmp = AB.pop()
        heapq.heappush(q, -tmp[1])
    if len(q) > 0:
        max_val = -heapq.heappop(q)
        cnt += max_val

print(cnt)
# Judge status: Accepted
n=int(input())
if n==1:
    print('a')
    exit()
ans=['a']
al=list('abcdefghijklmnopqrsruvwxyz')
for i in range(n-1):
    tmp=[]
    for j in ans:
        sn=len(set(j))
        for k in range(sn+1):
            tmp.append(j+al[k])  
    ans=tmp
ans.sort()
for i in ans:
    print(i)
# Judge status: Wrong Answer
A, B, C, X, Y = map(int, input().split())

if X > Y:
    many = A
else:
    many = B
    

if min(A, B) > 2 * C:
    ans = C * 2 * max(X, Y)
elif (A + B) / 2 < C:
    ans = A * X + B * Y
else:
    ans = min(X, Y) * 2 * C + (max(X, Y) - min(X, Y)) * many

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

while len(v) > 1:
    v.sort()
    t1 = v.pop(0)
    t2 = v.pop(0)

    v.append((t1 + t2) / 2)

print(v[0])
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))

x = [0]*N

for a in A:
    x[a-1] += 1

for i in x:
    print(i)
# Judge status: Accepted
#from math import gcd
from fractions import gcd
A,B = map(int,input().split())

#最小公倍数
def lcm(x,y):
    return (x*y//gcd(x,y))

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

A.sort()
A.reverse()

happy = A[0]
circle = [A[0], A[1]]
for i in range(2, N):
    circle.insert(len(circle)-1, A[i])
    happy += min(circle[-1], circle[-3])

print(happy)
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
seki = [(1 + i*(i+1)//2)%N for i in range(2*M)]
for i in range(M):
    print(seki[2*i], seki[2*i + 1])
# Judge status: Wrong Answer
n = int(input())

a = [input() for i in range(n)]

for i in range(n):
    a[i] = ''.join(sorted(a[i]))

a = sorted(a)

ans = 0
sum = 1
for i in range(n-1):
    if a[i] == a[i+1]:
        sum += 1
    else :
        ans += (sum*(sum-1))/2
        sum = 1

ans += (sum*(sum-1))/2
print(ans)
# Judge status: Accepted
A, B = map(int,input().split())
if A < 10 and B < 10: print(A * B)
else: print(-1)
# Judge status: Accepted
N = int(input())

# 1食 800 円で、15食食べる毎にその場で200 円値引き。
# 合計 N 食
# 今までに払った金額を x 円、レストランからもらった金額を y 円として、
# x−y を求めなさい。
x = 800 * N
y = N // 15 * 200

print(x - y)
# Judge status: Accepted
X = int(input())
ans = 1
for i in range(2,1000):
    for j in range(2,10):
        if i**j <= X:
            ans = max(ans,i**j)
print(ans)
# Judge status: Accepted
w, h, x, y = map(int, input().split())
half = h*w / 2
if 2*x == w and 2*y == h:
    p = 1
else:
    p = 0

print(half, p)
# Judge status: Wrong Answer
input_from = input()
info = input_from.split(' ')
a = int(info[0])
b = int(info[1])
k = int(info[2])
a -= k
if a < 0:
    b += a
    a = 0
print("{0} {1}".format(a, b))
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
c=0
for i in range(1,n-1):
  if min(p[i-1],p[i+1])<p[i]<max(p[i-1],p[i+1]):
    c+=1
print(c)
# Judge status: Wrong Answer
S=input()
flag=False
for i in range(len(S)):
  if i%2==0:
    if S[i]!='R' and S[i]!='U' and S[i]!='D':
      flag=True
  else:
    if S[i]!='L' and S[i]!='U' and S[i]!='D':
      flag=True
if flag==True:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
n,m=map(int,input().split())
cnt_s=n
cnt_c=m
ans=0
if cnt_s>cnt_c:
  ans=cnt_c//2
  print(ans)
elif cnt_s<=cnt_c:
  ans+=min(n,cnt_c//2)
  cnt_c-=2*min(n,cnt_c//2)
  ans+=cnt_c//4
  print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

s = b[a[0]-1]

for i in range(1,n):
    s += b[a[i]-1]
    if(a[i] == a[i-1]+1):s+=c[a[i-1]-1]
print(s)
# Judge status: Accepted
K = int(input())
A, B = list(map(int, input().split()))
for i in range(A, B+1):
    if i%K == 0:
        print('OK')
        exit()
print('NG')
# Judge status: Wrong Answer
S,T = input().split()
print(S,T)
# Judge status: Accepted
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

q,h,s,d = map(int,input().split())
n = int(input())
h = min(q*2,h)
s = min(h*2,s)
if n == 1:
    print(s)
    sys.exit()

if 2*s > d:
    print(d*(n//2) + (n%2)*s)
else:
    print(n*s)
# Judge status: Wrong Answer
N=int(input())

for i in range(N):
    t,x,y = map(int,input().split())
    if ((x+y+t)%2 != 0) & ((x+y)<t):
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
A, B = map(int,input().split())

if A > 12:
	print(B)
elif 6 <= A <= 12:
	print(B/2)
else:
	print(0)