Harryxun/stf_run huggingface dataset:
import numpy as np
def q3(a,b):
    return np.lcm(a,b)

ans = input().split()
a = int(ans[0])
b = int(ans[1])
print(q3(a,b))

### FIXED CODE ###

def q3(a,b):
  x = a*b
  if(a<b):
    tmp = a
    a=b
    b=tmp
  r=a%b
  while(not(r==0)):
    a=b
    b=r
    r=a%b
  return int(x/b)


ans = input().split()
a = int(ans[0])
b = int(ans[1])
print(q3(a,b))
n = int(input())
s = input()

r = [0] * n
g = [0] * n
b = [0] * n
dc = {'R':[0]*n,'G':[0]*n,'B':[0]*n}
for i in range(n-1)[::-1]:
    dc['R'][i] = dc['R'][i + 1]
    dc['G'][i] = dc['G'][i + 1]
    dc['B'][i] = dc['B'][i + 1]
    dc[s[i+1]][i] += 1
# print(dc['R'])
# print(dc['G'])
# print(dc['B'])
dcc = {('R','G'):'B',('R','B'):'G',('B','G'):'R',('G','R'):'B',('B','R'):'G',('G','B'):'R'}
if(n <= 3):print(0)
else:
    c = 0
    for i in range(n):
        for j in range(i+1,n):
            if(s[i] == s[j]):continue
            d = j - i
            c += dc[dcc[(s[i],s[j])]][j]
            k = j + d
            if(k < n):
                if(s[k] == dcc[(s[i],s[j])]):c -= 1
print(c)

### FIXED CODE ###

n = int(input())
s = input()
d = [0,0,0]
for i in s:
    if(i == 'R'):d[0] += 1
    elif(i == 'G'):d[1] += 1
    elif(i == 'B'):d[2] += 1
c = d[0] * d[1] * d[2]

for i in range(n):
    for j in range(i+1,n):
        k = 2 * j - i
        if(k >= n):continue
        if(s[i] == s[j]):continue
        if(s[j] == s[k]):continue
        if(s[i] == s[k]):continue
        c -= 1

print(c)
a,b,c = int(input().split())

for i in range(c):
  if(a == 0):
  	c -=1
  elif(a > 0):
    a -= 1
print(str(a),str(b))
    


### FIXED CODE ###

a,b,c = map(int, input().split())
 
print(max(0,a-c),max(0, b - max(0,c-a)))
def c(int x, int y)
  temp = y
  y = x
  x = temp
     
for i in range(3):
  n[i] = input()
  for j in range(3):
    if n[i] > n[j]:
      c(i, j)

print "%d %d %d" % (n[1], n[2], n[3])

### FIXED CODE ###

n=map(int, raw_input().split())
max_min=sorted(n)
for i in range(len(max_min)):
    print max_min[i],
from collections import defaultdict

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

dict = defaultdict(lambda: 0)
dict[1] = 1
next = A[0]

for k in range(1,K+1):
    if dict[next] !=0:
        roop_start = dict[next]
        roop_end = k
        break
    dict[next] = k+1
    next = A[next-1]

roop = roop_end - roop_start + 1
teleport = roop_start + (K - roop_start)%roop

next = 1
for i in range(teleport):
    next = A[next-1]

print(next)    


### FIXED CODE ###

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

town = [0 for i in range(N+1)]

def next(A,now):
    return(A[now-1])

now = 1
i = 0
while True:
    if town[now] != 0:
        roop_start = town[now]
        roop_end = i
        break
    town[now] = i+1
    now = next(A,now)
    i += 1

roop = roop_end - roop_start + 1
teleport = min(roop_start + (K - roop_start)%roop,K)

now = 1
for i in range(teleport):
    now = next(A,now)

print(now)
N = int(input())

m = int(N **0.5)
for i in range(1,m):
    j = N / i
    if int(j) < j:
        continue
    k = i
a = N // k
ans=0
while a >= 1:
    a //=10
    ans+=1

print(ans)


### FIXED CODE ###

N = int(input())

m = int(N **0.5)+1
for i in range(1,m):
    j = N // i
    if i*j < N:
        continue
    k = i
a = N // k
ans=0
b = str(a)
ans = len(b)

print(ans)
N = input()
if (N % 100) % 10 in [2,4,5,7,9]:
  print("on")
elif (N % 100) % 10 in [0,1,6,8]:
  print("hon")
else:
  print("bon")

### FIXED CODE ###

N = input()
N = int(N)
if (N % 100) % 10 in [2,4,5,7,9]:
  print("hon")
elif (N % 100) % 10 in [0,1,6,8]:
  print("pon")
else:
  print("bon")
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
E=[list(map(int,input().split())) for i in range(M)]
S,G=map(int,input().split())

ELIST=[set() for i in range(N+1)]

for x,y in E:
    ELIST[x].append(y)


DIS=[-1]*(N+1)
from collections import deque
DIS[S]=0
S=deque([S])

SA=[0]
while S:
    x=S.pop()
    NEWS=deque()

    for to in ELIST[x]:
        if DIS[to]==-1:
            DIS[to]=i
            NEWS.append(to)
        if DIS[to]<i:
            SA.append(i-to)
        

    i+=1
    S=NEWS

if DIS[G]==-1:
    print(-1)
else:
    SA.sort()
    for s in SA:
        if (DIS[G]+s)%3==0:
            print((DIS[G]+s))

            
        
    


### FIXED CODE ###

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
E=[list(map(int,input().split())) for i in range(M)]
S,G=map(int,input().split())

ELIST=[[] for i in range(N+1)]

for x,y in E:
    ELIST[x].append(y)

DIS=[[-1,-1,-1] for i in range(N+1)]
DIS[S][0]=0

from collections import deque

S=deque([S])
i=1

while S:
    #print(S)
    NEWS=deque()
    while S:     
        x=S.pop()

        for to in ELIST[x]:
            if DIS[to][i%3]==-1:
                DIS[to][i%3]=i
                NEWS.append(to)

    i+=1
    S=NEWS

print(DIS[G][0]//3)
K = int(input())
A,B = map(int,input().split())

if K - A % K <= B-A:
    print("OK")
elif k == 1:
    print("OK")
else:
    print("NG")


### FIXED CODE ###

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

for i in range(A,B+1):
    if i % K == 0:
        print("OK")
        exit()
print("NG")
import numpy as np

n = int(input())
li = list(map(int,input().split()))
ans = 0
lgcd = [li[0]]
rgcd = [li[-1]]

for i in range(n-1):
    lgcd.append(np.gcd(lgcd[-1],li[i+1]))
    rgcd.insert(0,np.gcd(rgcd[0],li[-(i+2)]))

gcd_list = [lgcd[-2],rgcd[1]]

for i in range(n-2):
    gcd_list.append(np.gcd(lgcd[i],rgcd[i+2]))

print(max(gcd_list))


### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))
ans = 0
lgcd = [0]*n
rgcd = [0]*n
lgcd[0] = li[0]
rgcd[-1] = li[-1]

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

for i in range(n-1):
    lgcd[i+1] = gcd(lgcd[i],li[i+1])
    rgcd[-i-2] = gcd(rgcd[-i-1],li[-(i+2)])

gcd_list = [gcd(lgcd[i],rgcd[i+2]) for i in range(n-2)]

gcd_list.append(lgcd[-2])
gcd_list.append(rgcd[1])

print(max(gcd_list))
A, B = map(int, input().split())
E = []
total = A
for i in range(B):
    C = int(input())
    D = map(int, input().split())
    E.append(list(D))

for i in range(A):
  if str(i+1) in str(E):
    total = total - 1

print(total)

### FIXED CODE ###

I = input()
print("ABC" if I == "ARC" else "ARC")
N=int(input())
S=input()
D={"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(D[S])

### FIXED CODE ###

DAYS=["SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"]
S=input()

for i, day in enumerate(DAYS):
  if S==day:
    print(i+1)
i = int(input())
x = i // 11
a = x * 2
b = i % 11
if b = 0:
    break
elif b <= 6:
    a += 1
else:
    a += 2
print(a)


### FIXED CODE ###

i = int(input())
x = i // 11
a = x * 2
b = i % 11
if b == 0:
    pass
elif b <= 6:
    a += 1
else:
    a += 2
print(a)
N = int(input())
lst = list(map(int, input().split()))
cnt = 0
for i in range(N-1):
    if lst[i] < lst[i+1]:
        cnt += 
print(cnt)




#139 c
N = int(input())
H = list(map(int, input().split()))
max_lst = []
min_lst = []
max_h = H[0]
min_h = H[0]
s = 0
for i in range(1, N):
    if H[i-1] <= H[i]:
        if H[0] not in max_lst and H[0] not in min_lst:
            min_lst.append(H[0])
        if max_h == 0:
            min_lst.append(min_h)
        if i == N-1:
            max_lst.append(H[i])
        max_h = H[i]
        min_h = 0
    elif H[i-1] >= H[i]:
        if H[0] not in max_lst and H[0] not in min_lst:
            max_lst.append(H[0])
            s = 1
        if min_h == 0:
            max_lst.append(max_h)
        if i == N-1:
            min_lst.append(H[i])
        min_h = H[i]
        max_h = 0
cnt = 0
if s == 0:
    for i in range(len(min_lst)-1):
        cnt += max_lst[i] - min(min_lst[i], min_lst[i+1])
    cnt += max_lst[-1] - min_lst[-1]
else:
    for i in range(1, len(max_lst)):
        cnt += max_lst[i] - min(min_lst[i-1], min_lst[i])
    cnt += max_lst[0] - min_lst[0]
print(cnt)

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
ans = 0
H.append(0)
for i in range(max(H)):
    cnt = 0
    for k in range(N):
        if H[k] != 0 and H[k+1] == 0:
            cnt += 1
    ans += cnt
    H = list(map(lambda x:(x-1, 0)[x == 0], H))
print(ans)
X,Y = int(input())
print(int(X + Y /2))

### FIXED CODE ###

X,Y = map(int,input().split())
print(int(X + Y /2))
K,A,B = list(map(int,input().split()))
if A>=B-2:
    answer = K+1
else:
  # gutyoku
    first = A
    rest = K - A -1
    if rest%2==0:
        answer = (rest/2+1)*B - (rest/2)*A
    else:
        #print('else')
        answer = ((rest-1)/2+1)*B - ((rest-1)/2)*A+1
    
print(int(answer))


### FIXED CODE ###

N,K = list(map(int,input().split()))
if N >= 2*K -1:
  print("YES")
else:
  print("NO")
= [i for i in input()]
f = True
i = 0
cnt = 0
while True:
    if s[i] == 'B' and s[i+1] == 'W':
        cnt += 1
        s[i] = 'W'
        s[i+1] = 'B'
        i += 1
        f = False
    else:
        i += 1
    if i >= len(s) - 1:
        if f:
            break
        i = 0
        f = True
print(cnt)

### FIXED CODE ###

s = [i for i in input()]
B_pos_ls = []
for i, x in enumerate(s):
    if x == 'B':
        B_pos_ls.append(i)
res = 0
B_pos_ls.sort(reverse=True)
last_B_pos = len(s) - 1
for B_pos in B_pos_ls:
    res += last_B_pos - B_pos
    last_B_pos -= 1
print(res)
n=int(input())
l=[-1]*n
p=[[] for _ in range(n)]
for i in range(n-1):
    ui,vi,wi=map(int,input().split())
    p[ui-1].append([vi,wi])
    p[vi-1].append([ui,wi])

def tr1(x,y):
    #print(x)
    #print(y)
    
    if l[x-1]!=-1:
        return
    l[x-1]=y
    for i in range(len(p[x-1])):
        tr1(p[x-1][i][0],(y+p[x-1][i][1])%2)
tr1(1,0)
for j in range(n):
    print(l[j])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n=int(input())
l=[-1]*n
p=[[] for _ in range(n)]
for i in range(n-1):
    ui,vi,wi=map(int,input().split())
    p[ui-1].append([vi,wi])
    p[vi-1].append([ui,wi])

def tr1(x,y):
    #print(x)
    #print(y)
    
    if l[x-1]!=-1:
        return
    l[x-1]=y
    for i in range(len(p[x-1])):
        tr1(p[x-1][i][0],(y+p[x-1][i][1])%2)
tr1(1,0)
for j in range(n):
    print(l[j])
N,P=map(int,input().split())
for x in range(max(int(P**(1/N))+1,1),0,-1):
  if P%(x**N)==0:
    print(x)
    exit()


### FIXED CODE ###

def primes(n):
  ps = {}
  while n%2==0:
    n//=2
    if 2 not in ps:
      ps[2] = 1
    else:
      ps[2] += 1
  
  for i in range(3,int(n**.5)+1,2):
    while n%i==0:
      n//=i
      if i not in ps:
        ps[i] = 1
      else:
        ps[i] += 1
  
  if n!=1:
    ps[n] = 1
  
  return ps
  
N,P = map(int,input().split())
if N==1:
  print(P)
  exit()
ps = primes(P)
ans = 1
for p, num in ps.items():
  if num>=N:
    ans *= p**(num//N)
print(ans)
import math
    def cmb(n, r):
        return math.factorial(n)// ( math.factorial(n-r) * math.factorial(r) )
     
     
     
    N,M = input().split()
     
    N = int(N)
    M = int(M)
     
    a = []
    ans = 1
     
    for i in range(M):
        newa = int(input())
        a.append(newa)
     
    if (M != 0):
        for k in range(M-1):
            if (a[k+1] - a[k] == 1):
                ans = 0
                
        
        
        for i in range(M + 1):
        
     
            if (i == 0):
                dan = a[i] - 1
            elif (i == M):
                dan = N - a[i - 1] - 1
            else:
                dan = a[i] - a[i - 1] - 2
     
            abletwo = (dan - (dan % 2)) // 2
            now = 0
     
            if (dan != 0):
     
                for j in range(abletwo + 1):
     
                    now += cmb (dan - j , j )
     
            else:
                now = 1
            
            ans *= now
     
    else:
        ans = 0
        abletwo = (N - (N % 2)) // 2
     
        for j in range(abletwo + 1):
     
            ans += cmb (N - j , j )
     
    ans = ans % 1000000007
    print (ans)

### FIXED CODE ###


N, M = input().split()

N = int(N)
M = int(M)
a = []
c = []

for i in range(M):

    anew = int(input())
    a.append(anew)

now_a = 0
a.append(-1)
ans = 0

for i in range( N + 1 ):

    if (i == 0):
        c.append(1)
        
    elif (i == 1):

        if (a[now_a] == i):
            c.append(0)
            now_a += 1
        else:
            c.append(1)

    else:

        if (a[now_a] == i):
            c.append(0)
            now_a += 1
        else:
            c.append( c[i - 1] + c[i - 2])
        

ans = c[N] % 1000000007

print (ans)
a = input()
b = input()
c = input()

def match(c1, c2):
    return c1 == '?' or c2 == '?' or c1 == c2

M = 2000

ab, ac, bc = [], [], []
for _  in range(10000):
    ab.append(0)
    ac.append(0)
    bc.append(0)


A, B, C = len(a), len(b), len(c)
for i in range(A):
    for j in range(B):
        if not match(a[i], b[j]):
            ab[i-j+5000] = 1
for i in range(A):
    for j in range(C):
        if not match(a[i], c[j]):
            ac[i-j+5000] = 1
for i in range(B):
    for j in range(C):
        if not match(b[i], c[j]):
            bc[i-j+10000] = 1

ans = 3 * M

for i in range(-2*M, 2*M):
    for j in range(-2*M, 2* M):
        if ab[i+5000] == 0 and ac[j+5000] == 0 and bc[j-i+10000] == 0:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R - L)

print(ans)


### FIXED CODE ###

a = input()
b = input()
c = input()

def match(c1, c2):
    return c1 == '?' or c2 == '?' or c1 == c2

M = 2000

ab, ac, bc = [], [], []
ab_append = ab.append
ac_append = ac.append
bc_append = bc.append

for _  in range(10000):
    ab_append(0)
    ac_append(0)
    bc_append(0)

for _  in range(10000):
    bc_append(0)

A, B, C = len(a), len(b), len(c)
for i in range(A):
    for j in range(B):
        if not match(a[i], b[j]):
            ab[i-j+5000] = 1
for i in range(A):
    for j in range(C):
        if not match(a[i], c[j]):
            ac[i-j+5000] = 1
for i in range(B):
    for j in range(C):
        if not match(b[i], c[j]):
            bc[i-j+10000] = 1

ans = 3 * M

for i in range(-2*M, 2*M):
    for j in range(-2*M, 2* M):
        if ab[i+5000] == 0 and ac[j+5000] == 0 and bc[j-i+10000] == 0:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R - L)

print(ans)
import sys
import itertools
n=int(input())
l=list(map(int,input().split()))
l.sort()
s=set(l)
if len(s)>=4 :print("No");sys.exit()
if len(s)==1:print("Yes" if 0 in s else "No")
s=list(s)
if len(s)==2:
  if 0 not in s:print("No");sys.exit()
  if n%3==1:
    if l.count(0)==(n-1)//3:print("Yes");sys.exit()
    else:print("No");sys.exit()
  elif n%3==2:
    if l.count(0)==(n+1)//3:print("Yes");sys.exit()
    else:print("No");sys.exit()
  elif n%3==0:
    if l.count(0)==n//3:print("Yes");sys.exit()
    else:print("No");sys.exit()
flag=0
for i in itertools.permutations(s):
  if i[0]^i[2]==i[1] and i[1]^i[2]==i[0] and i[0]^i[1]==i[2]:flag+=1
if flag==6:print("Yes")
else:print("No")


### FIXED CODE ###

import sys
import itertools
n=int(input())
l=list(map(int,input().split()))
l.sort()
s=set(l)
if len(s)>=4 :print("No");sys.exit()
if len(s)==1:print("Yes" if 0 in s else "No");sys.exit()
s=list(s);s.sort()
if len(s)==2:
  if 0 not in s:print("No");sys.exit()
  if n%3==1:
    if l.count(0)==(n-1)//3:print("Yes");sys.exit()
    else:print("No");sys.exit()
  elif n%3==2:
    if l.count(0)==(n+1)//3:print("Yes");sys.exit()
    else:print("No");sys.exit()
  elif n%3==0:
    if l.count(0)==n//3:print("Yes");sys.exit()
    else:print("No");sys.exit()
a=l.count(s[0]);b=l.count(s[1]);c=l.count(s[2])
if a!=b or b!=c or c!=a:print("No");sys.exit()
flag=0
for i in itertools.permutations(s):
  if i[0]^i[2]==i[1] and i[1]^i[2]==i[0] and i[0]^i[1]==i[2]:flag+=1
if flag!=0:print("Yes")
else:print("No")
n = input()
for i in range(1,n+1):
    if(i%3==0):
        print('%d'%(i),end="")
    elif(i%10==3):
        print('%d' % (i), end="")


### FIXED CODE ###

n = int(input())
print(" ",end="")
print(*[i for i in range(1,1+n) if i%3==0 or'3' in str(i)])
N,S =input().split()
N = int(N)
A = 0
R = []
G = []
B = []
for i in range(len(S)):
  if S[i] == "R":
    R.append(i+1)
  elif S[i] == "G":
    G.append(i+1)
  else:
    B.append(i+1)
for r in R:
  for g in G:
    for b in B:
      C = sorted([r,g,b])
      if C[1] - C[0] != C[2] - C[1]:
        A += 1
print(A)
        

### FIXED CODE ###

N =int(input())
S = str(input())
A = 0
R = []
G = []
B = []
for i in range(len(S)):
  if S[i] == "R":
    R.append(i+1)
  elif S[i] == "G":
    G.append(i+1)
  else:
    B.append(i+1)

A = len(R)*len(G)*len(B)
for i in range(N):
  for j in range(i+1,N):
    k = j + (j-i)
    if k >= N:
      break
    if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
      A -= 1
print(A)
test

### FIXED CODE ###

import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = ['No'] * N
    for i,v in dict(c).items():
        if v >(Q - K):
            l[i-1] = 'Yes'
    for j in l:
        print(j)
# ABC044
N, A = map(int, input().split())
X = list(map(int, input().split()))

# 2 ** 50 -> 全探索は厳しい -> DP
# dp[i][k][wa] = i枚まで見て、k枚選んだ時の合計値がwaとなるときの選び方の合計
# max wa = max(X) * N
max_wa = max(X) * N

dp = [[[0] * 2550 for _ in range(N+1)] for __ in range(N+1)]
dp[0][0][0] = 1
for i in range(N):
    for k in range(N):
        for wa in range(2501):
            # 選ぶとき
            dp[i+1][k+1][wa+X[i]] += dp[i][k][wa]
            # 選ばないとき
            dp[i+1][k][wa] += dp[i][k][wa]

ans = 0
for k in range(1, N+1):
    ans += dp[-1][k][k*A]

print(ans)

### FIXED CODE ###

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

# 2 ** 50 -> 全探索は厳しい -> DP
# dp[i][k][wa] = i枚まで見て、k枚選んだ時の合計値がwaとなるときの選び方の合計
# max wa = max(X) * N
max_wa = max(X) * N
dp = [[[0] * (max(X) * (N+1)) for _ in range(N+1)] for __ in range(N+1)]
dp[0][0][0] = 1
for i in range(N):
    for k in range(i+1):
        for wa in range(max_wa):
            # 選ぶとき
            dp[i+1][k+1][wa+X[i]] += dp[i][k][wa]
            # 選ばないとき
            dp[i+1][k][wa] += dp[i][k][wa]

ans = 0
for k in range(1, N+1):
    if k * A > max_wa:
        break
    ans += dp[-1][k][k*A]

print(ans)
n, q = map(int, input().split())

tree_index = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int, input().split())
  a -= 1
  b -= 1
  tree_index[a].append(b) # a<bとは限らないため、双方向にする
  tree_index[b].append(a)
ans = [0] * n
for i in range(q):
  p, x = map(int, input().split())
  ans[p-1] += x
def dfs(cur, par):
    for chl in tree_index[cur]:
      if chl == par: #parentとchildが等しい時はスキップ
        continue
      ans[chl] += ans[cur] 
      dfs(chl, cur)
dfs(0, -1)
print(*ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline #for input speed
sys.setrecursionlimit(10**6) #for deep recursion
n, q = map(int, input().split())

tree_index = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int, input().split())
  a -= 1
  b -= 1
  tree_index[a].append(b) # a<bとは限らないため、双方向にする
  tree_index[b].append(a)
ans = [0] * n
for i in range(q):
  p, x = map(int, input().split())
  ans[p-1] += x
def dfs(cur, par):
    for chl in tree_index[cur]:
      if chl == par: #parentとchildが等しい時はスキップ
        continue
      ans[chl] += ans[cur] 
      dfs(chl, cur)
dfs(0, -1)
print(*ans)
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
	  price += p[i]
  
print(price)


### FIXED CODE ###

alpha = input()
print('A' if alpha.isupper() else 'a')
A, B = map(int, input().slipt())
print((A+B) % 24)

### FIXED CODE ###

A, B = map(int, input().split())
print((A+B) % 24)
a,b,k=map(int,input().split())
 
cnt=0
 
for i in range(1,min(a,b)):
	ans=0
	if a%i==0 and b%i==0:
		ans+=i
		cnt+=1
	if cnt==k:
		break
print(ans)

### FIXED CODE ###

a,b,k=map(int,input().split())
 
ans=[]
 
for i in range(1,min(a,b)+1):
	if a%i==0 and b%i==0:
		ans.append(i)
print(ans[-k])
y,m,d = input().split("/")
flag = False
if(int(y) > 2019) :
  flag = True
elif(int(y) == 2019):
  if(m>=5):
    flag = True
print("TBD" if flag else "Heisei")

### FIXED CODE ###

y,m,d = input().split("/")
flag = False
if(int(y) > 2019) :
  flag = True
elif(int(y) == 2019):
  if(int(m)>=5):
    flag = True
print("TBD" if flag else "Heisei")
array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 =! 0]
array4 = [i % 10 for i in array3]
sum1 = 0
sum2 = sum(array2)
if (len(array3) != 0):
  idx = array4.index(min(array4))
  for k, i in enumerate(array3):
    if (k == idx):
      sum1 += i
    else:
      sum1 += i + (10 - i % 10)
print(sum1 + sum2)


### FIXED CODE ###

array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 != 0]
array4 = [i % 10 for i in array3]
sum1 = 0
sum2 = sum(array2)
if (len(array3) != 0):
  idx = array4.index(min(array4))
  for k, i in enumerate(array3):
    if (k == idx):
      sum1 += i
    else:
      sum1 += i + (10 - i % 10)
print(sum1 + sum2)
N,M = map(int,input().split())
A = [int(input()) for _ in range(M)]
mod = 1000000007
dp=[0]*(N+1)
dp[0]=1
if A[0]!=1:dp[1]=1 
else:dp[1]=0
    
for i in range(2,N+1):
    if i in A:
        dp[i]=0
    else:
        dp[i] = (dp[i-1]+dp[i-2])%mod

print(dp[N])

### FIXED CODE ###

mod = 10**9+7
n,m = map(int,input().split())
a = set()
for i in range(m):
  a.add(int(input()))
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1) :
    dp[i] = (dp[i-1] + dp[i-2]) % mod
    if i in a :
        dp[i] = 0
print(dp[n])
s=input()
ans=0
for i in range(len(s):):
  if s[i]!=s[i+1]:
    ans+=1
print(ans)

### FIXED CODE ###

s=input()
ans=0
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    ans+=1
print(ans)
n,m = map(int,input().split())
listA = [list(map(int, list(input()))) for i in range(n)]
listB = [list(map(int, list(input()))) for j in range(m)]
listC=[]
for k in range(n):
  for l in range(m):
    listC.append(abs(listA[k][0]-listB[l][0])+abs(list[k][1]-listB[l][1]))
  listC.sort()
  print(listC[0])


### FIXED CODE ###

n,m = map(int,input().split())
listA = [list(map(int, input().split())) for i in range(n)]
listB = [list(map(int, input().split())) for j in range(m)]
listC=[]

for k in range(n):
  b=0
  c=0
  for l in range(m):
    a=abs(listA[k][0]-listB[l][0])+abs(listA[k][1]-listB[l][1])
    if a<b or l==0:
      b=a
      c=l
  print(c+1)
zyouken = [int(i) for i in input().split()]
reizouko = [int(a) for a in input().split()]
densirenzi = [int(b) for b in input().split()]
minkouho = min(reizouko) + min(densirenzi)
while zyouken[2] > 0:
    zyouken[2] = zyouken[2] - 1
    waribiki = [int(w) for w in input().split()]
    mink = reizouko[waribiki[0]] + densirenzi[waribiki[1]] - waribiki[2]
    if mink < minkouho:
        minkouho = mink
print(minkouho)

### FIXED CODE ###

zyouken = [int(i) for i in input().split()]
reizouko = [int(a) for a in input().split()]
densirenzi = [int(b) for b in input().split()]
minkouho = min(reizouko) + min(densirenzi)
while zyouken[2] > 0:
    zyouken[2] -= 1 
    waribiki = [int(w) for w in input().split()]
    mink = reizouko[waribiki[0] - 1] + densirenzi[waribiki[1] - 1] - waribiki[2]
    if mink < minkouho:
        minkouho = mink
print(minkouho)