Harryxun/stf_run huggingface dataset:
import math
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))




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


a,b=input2()

print(lcm(a,b))


### FIXED CODE ###

import math
import fractions
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))




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


a,b=input2()

print(lcm(a,b))
def resolve():
    n = int(input())
	ans = 0
	for i in range(1, n+1):
		if i % 2 == 0:
			ans += 1
	print(ans)
resolve()

### FIXED CODE ###

def resolve():
	n = int(input())
	ans = 0
	dp = [0]*(n+1)
	for i in range(1, n+1):
		if i % 2 == 0:
			dp[i] = dp[i//2] + 1
	print(dp.index(max(dp)) or 1)
resolve()
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def is_match(parent, child, pi, pj):
    for ci in range(len(child)):
        for cj in range(len(child[ci])):
            # c = child[ci][cj]
            # p = parent[pi+ci][pj+cj]
            if child[ci][cj] != parent[pi+ci][pj+cj]:
                return False
    return True


def solve(N, M, inputs):
    map_parent = list(map(list, inputs[:N]))
    map_child = list(map(list, inputs[N:]))

    for pi in range(0, M):
        for pj in range(0, M):
            if is_match(map_parent, map_child, pi, pj):
                return 'Yes'
    return 'No'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    [N, M] = string_to_int(input())
    ret = solve(N, M, inputs(N+M))
    print(ret)


### FIXED CODE ###

import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def is_match(parent, child, pi, pj):
    for ci in range(len(child)):
        for cj in range(len(child[ci])):
            # c = child[ci][cj]
            # p = parent[pi+ci][pj+cj]
            if child[ci][cj] != parent[pi+ci][pj+cj]:
                return False
    return True


def solve(N, M, inputs):
    map_parent = list(map(list, inputs[:N]))
    map_child = list(map(list, inputs[N:]))

    for pi in range(0, N-M+1):
        for pj in range(0, N-M+1):
            if is_match(map_parent, map_child, pi, pj):
                return 'Yes'
    return 'No'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    [N, M] = string_to_int(input())
    ret = solve(N, M, inputs(N+M))
    print(ret)
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N, M = map(int, input().split())
    a_list = [int(input()) for _ in range(M)]

    dp=[0 for _ in range(N+1)]

    divider = 1000000007
    dp[0], dp[1] = 1, 1
    for i in range(2,N+1):
        dp[i]=(dp[i-1]+dp[i-2])%divider

    p = 0
    ans = 1
    for a in a_list:
        r = dp[a-1-p] if a-1 >= p else 0
        ans = (ans*r)%divider 
        p = a + 1
    else:
        if a < N:
            r = dp[N-p]%divider
            ans = (ans*r)%divider

    print(ans)
        

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc129","c",main)

### FIXED CODE ###

#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N, M = map(int, input().split())
    a_list = [int(input()) for _ in range(M)]

    p = 0
    steps=[]
    m = 0
    for a in a_list:
        if a != 1:
            steps.append((p, a-1))
            m = max(m, a-p)
        p = a + 1
    else:
        steps.append((p, N))
        m = max(m, N-p+1)

    dp=[0 for _ in range(m+1)]

    divider = 1000000007
    dp[0], dp[1] = 1, 1
    for i in range(2,m+1):
        dp[i]=(dp[i-1]+dp[i-2])%divider

    ans = 1
    for p, n in steps:
        if n < p:
            ans = 0
            break
        else:
            r = dp[n-p]
        ans = (ans*r)%divider 

    print(ans)
        

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc129","c",main)
cnt = int(input())
v = []

for i in range(cnt):
    v[i] = int(input())

print(v[1])

### FIXED CODE ###

cnt = int(input())
dif_max = -1000000000
v_min = 1000000000

for i in range(cnt):
    buf = int(input())
    if i > 0:
        dif_max = dif_max if buf - v_min < dif_max else buf - v_min
    v_min = buf if buf < v_min else v_min
print(dif_max)
S = list(input())
ansarr = []
ans = 0
for i in S:
    if ans == 0:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
    else:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
        elif i != 'A' or i != 'C' or i != 'G' or i != 'T':
            ansarr.append(ans)
            ans = 0

print(max(ansarr))


### FIXED CODE ###

S = list(input())
ansarr = []
ans = 0
ansarr.append(ans)
for i in S:
    if ans == 0:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
    else:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
        elif i != 'A' or i != 'C' or i != 'G' or i != 'T':
            ansarr.append(ans)
            ans = 0
else:
    ansarr.append(ans)


print(max(ansarr))
N, A, B = map(int, input().split())
print(mint(N*A, B))

### FIXED CODE ###

N, A, B = map(int, input().split())
print(min(N*A, B))
a, b = map(int, input().split())
A = int(str(a)**b)
B = int(str(b)**a)

if A >= B:
    print(A)
else:
    print(B)

### FIXED CODE ###

a, b = map(int, input().split())
A = int(str(a)*b)
B = int(str(b)*a)

if A >= B:
    print(A)
else:
    print(B)
s=input()
i=1
s0=s[0]
ct=1
while i<len(s)-1:
  print(s0)
  if s0==s[i]:
    s0=s[i:i+2]
    i+=2
  else:
    s0=s[i]
    i+=1
  ct+=1
if i>len(s):
  print(ct)
elif s0==s[i]:
  print(ct)
else:
  print(ct+1)

### FIXED CODE ###

s=input()
i=1
s0=s[0]
ct=1
while i<len(s)-1:
  if s0==s[i]:
    s0=s[i:i+2]
    i+=2
  else:
    s0=s[i]
    i+=1
  ct+=1
if i>=len(s):
  print(ct)
elif s0==s[i]:
  print(ct)
else:
  print(ct+1)
import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)


ret = 0
for i in lis:

    ret = i
    if i >= N:
        break

print(M//ret )


### FIXED CODE ###

import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)


lis.sort()
i =1
for i in lis:
    if i >= N:
        break

print(M//i )
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 998244353

#C
def C():
    n = I()
    s = S()
    b = s.copy()
    ans = 0
    for i in range(n-1):
        if s[i] == "#" and s[i+1] == ".":
            ans += 1
            s[i+1] = "#"
    m = 0
    for i in range(n-1)[::-1]:
        if b[i] == "#" and b[i+1] == ".":
            m += 1
            b[i] = "."
    print(min(m,ans))
    return

#D
def D():
    n = I()
    a = IR(n)

    return

#E
def E():
    return

#F
def F():
    return


#Solve
if __name__ == "__main__":
    C()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 998244353

#C
def C():
    n = I()
    s = S()
    ans = float("inf")
    b = [0 for i in range(n)]
    for i in range(n):
        if s[i] == "#":
            b[i] = 1
    w = [0 for i in range(n)]
    for i in range(n):
        if s[i] == ".":
            w[i] = 1
    b.insert(0,0)
    w.insert(0,0)
    for i in range(n):
        b[i+1] += b[i]
        w[i+1] += w[i]
    for i in range(n+1):
        m = b[i]+w[n]-w[i]
        ans = min(ans,m)
    print(ans)
    return

#D
def D():
    n = I()
    a = IR(n)

    return

#E
def E():
    n = I()

    return

#F
def F():
    return


#Solve
if __name__ == "__main__":
    C()
n,m = map(int, input().split())
A = list(map(int,input().split()))

hw_days = 0

for i in len(A):
  hw_days += A(i)

vacation = n - hw_days

if vacation < 0:
  print(-1)
else:
  print(vacation)

### FIXED CODE ###

n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A[i]
  
if n < 0:
  print(-1)
else:
  print(n)
N,A,B=map(int,input().split())

Alltotal=0
for i in range(1,N+1):
  partTotal=0
  while i!=0:
    partTotal+=i%10
    i=i//10
  if A<=partTotal and partTotal<=b:
    Alltotal+=partTotal



### FIXED CODE ###

N,A,B=map(int,input().split())
 
Alltotal=0
for i in range(1,N+1):
  partTotal=0
  temp=i
  while temp!=0:
    partTotal+=temp%10
    temp=temp//10
    
  if A<=partTotal and partTotal<=B:
    Alltotal+=i
    #print(i)
print(Alltotal)
N = int(input())
A = np.array(list(map(int,input().split(" "))))
Q = int(input())
B = [list(map(int,input().split(" "))) for i in range(0,Q)]

for i in range(0,Q):
    index = [j for j, x in enumerate(A) if x == B[i][0]]
    A[index] = B[i][1]
    print(sum(A))
#print("\n".join(list(map(str,A.tolist()))))

### FIXED CODE ###

import collections
N = int(input())
A = list(map(int,input().split(" ")))
Q = int(input())
B = [list(map(int,input().split(" "))) for i in range(0,Q)]
ans = sum(A)
num = collections.Counter(A)
for i in range(0,Q):
    before, after = B[i][0], B[i][1]
    ans += num[before] * (after - before)
    num[after] += num[before]
    num[before] = 0
    print(ans)
import math
H, A= [int(i) for i in input().split()]
print(math.ceil(H,A))

### FIXED CODE ###

a,b = map(int,input().split())
print(a//b if a%b ==0 else a//b+1)
import sys
input = sys.stdin.buffer.readline
MOD = 10**9 + 7
N, K = map(int, input().split())
A = list(map(int, (input().split())))
ap = []
neg_cnt = 0
zero_cnt = 0
for a in A:
    if a<0:
        ap.append((-a, 1))     # sortで先に来るようマイナスを1にする
        neg_cnt += 1
    elif a==0:
        ap.append((0, 0))
        zero_cnt += 1
    else:
        ap.append((a, -1))
ap.sort(reverse=True)
# print(ap)
ans = 1
if neg_cnt==N and K%2:      # 全てが負で奇数個選ぶので、答えは負
    for i in range(K):
        ans *= ap[N-i-1][0] * ap[N-i-1][1] * -1
        ans %= MOD
else:                       # 答えは正
    neg_num = 0
    for i in range(K):
        if ap[i][1] == 1:
            neg_num += 1
    if neg_num % 2:     # 負の数が奇数だったら、-1して偶数回にし、正が出るまで見る
        neg_num -= 1
        K += 1
    i = 0
    while i < K:
    # for i in range(K):
        if ap[i][1] == 1:  # 負の数だったら、neg_num回まで
            if neg_num == 0:
                i += 1
                continue
            else:
                neg_num -= 1
        ans *= ap[i][0] * ap[i][1] * -1
        ans %= MOD
        i += 1

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
MOD = 10**9 + 7
N, K = map(int, input().split())
A = list(map(int, (input().split())))
pos, neg = [], []
for a in A:
    if a<0:
        neg.append(a)   # 負
    else:
        pos.append(a)   # 0以上
if pos:
    if N==K:    # 全て選択で負の数が奇数ならfalse（正にできない）
        ok = (len(neg)%2 == 0)
    else:
        ok = True
else:
    ok = (K%2 == 0) # すべて負で奇数ならfalse（正にできない）
ans = 1
if ok == False: # false（正にできない）場合、絶対値が小さいものからk個かける
    A.sort(key=abs)
    for i in range(K):
        ans *= A[i]
        ans %= MOD
else:
    pos.sort()              # 後ろから取っていくので正は昇順
    neg.sort(reverse=True)  # 後ろから取っていくので負は降順
    if K%2:
        ans *= pos.pop()    # kが奇数個なら1個は正を選ぶ
    p = []  # 2個ずつかけた数を格納
    while len(pos)>=2:
        p.append(pos.pop() * pos.pop())
    while len(neg)>=2:  # 負を2回かけるのでxは正
        p.append(neg.pop() * neg.pop())
    p.sort(reverse=True)
    for i in range(K//2):   # 降順にk//2個見ていく
        ans *= p[i]
        ans %= MOD
print(ans)
x,y,z=map(int,input().split(" "))
if z-y-y>2(pow(x, 0.5)+pow(y, 0.5)):
	print("Yes")
else:
 
	print("No")

### FIXED CODE ###

import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
	string s;
	while(cin>>s,s!="0"){
		int sum=0;
		for(int i=0;i<s.size();i++) sum+=s[i]-'0';
	cout<<sum<<endl;
	}
	return 0;
}

### FIXED CODE ###

while True:
	data=map(int,list(raw_input()))
	if data==[0]: break
	print sum(data)
inpt = map(int, raw_input().split())

for i in range(inpt[0], inpt[1]+1):
	if i < inpt[0] + inpt[2] or inpt[1] - inpt[2] < i:
		print i

### FIXED CODE ###

inpt = map(int, raw_input().split())

for i in range(inpt[0], inpt[0]+inpt[2]):
	if i > inpt[1]: break
	print i
for i in range(inpt[1]-inpt[2]+1, inpt[1]+1):
	if i >= inpt[0]+inpt[2]:
		print i
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H * W) - (h * H + w * W - h * w)

### FIXED CODE ###

H, W = map(int, input().split())
h, w = map(int, input().split())

print((H * W) - (h * W + w * H - h * w))
s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(t[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))

### FIXED CODE ###

s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(s[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))
mod = 10**9 + 7
def go(v):
    global tmp
    tmp += 1
    used[v] = True
    for i in range(len(g[v])):
        if not used[g[v][i]]:
            go(g[v][i])
def solve():
    n, m = map(int, input().split())
    global g, used, tmp
    tmp = 0
    g = [[] for i in range(n + 1)]
    ans = 0
    d = {}
    used = [False for i in range(n + 1)]
    for i in range(m):
        x, y = map(int, input().split())
        if (x, y) not in d:
            g[x].append(y)
            g[y].append(x)
            d[(x, y)] = 1
    for i in range(1, n + 1):
        if not used[i]:
            tmp = 0
            go(i)
            ans = max(ans, tmp)
    print(ans)
t = 1
while t > 0:
    solve()
    t -= 1

### FIXED CODE ###

import sys
sys.setrecursionlimit(200001)
mod = 10**9 + 7
def go(v):
    global tmp
    tmp += 1
    used[v] = True
    for i in range(len(g[v])):
        if not used[g[v][i]]:
            go(g[v][i])
def solve():
    n, m = map(int, input().split())
    global g, used, tmp
    tmp = 0
    g = [[] for i in range(n + 1)]
    ans = 0
    d = {}
    used = [False for i in range(n + 1)]
    for i in range(m):
        x, y = map(int, input().split())
        if (x, y) not in d:
            g[x].append(y)
            g[y].append(x)
            d[(x, y)] = 1
    for i in range(1, n + 1):
        if not used[i]:
            tmp = 0
            go(i)
            ans = max(ans, tmp)
    print(ans)
t = 1
while t > 0:
    solve()
    t -= 1
import collections
n = int(input())
v = list(map(int, input().split()))
if len(set(v)) == 1:
	print (n//2)
	exit()
a = v[1::2]
b = v[0::2]
if len(set(a)) == 1 and len(set(b)) == 1:
	print (0)
	exit()

aa = collections.Counter(a)
bb = collections.Counter(b)

yousoa = aa.most_common()[0][0]
maa = aa.most_common()[0][1]
yousob = bb.most_common()[0][0]
mbb = bb.most_common()[0][1]
if yousoa == yousob
	if len(a) == 1:
		ans = (len(a) - maa) + (len(b) - bb.most_common()[1][1])
	elif len(b) == 1:
		ans = (len(a) - aa.most_common()[1][1]) + (len(b)-mbb)
	else:
		ans = (len(a) - maa) + (len(b) - bb.most_common()[1][1])
else:
	ans = len(a)-maa + len(b)-mbb
print (ans)

### FIXED CODE ###

import collections
n = int(input())
v = list(map(int, input().split()))
if len(set(v)) == 1:
	print (n//2)
	exit()
a = v[1::2]
b = v[0::2]
if len(set(a)) == 1 and len(set(b)) == 1:
	print (0)
	exit()
ans = 0

aa = collections.Counter(a)
bb = collections.Counter(b)

yousoa = aa.most_common()[0][0]
maa = aa.most_common()[0][1]
yousob = bb.most_common()[0][0]
mbb = bb.most_common()[0][1]
if len(set(a)) == 1:
	ans += len(b) - mbb
	print (ans)
	exit()
if len(set(b)) == 1:
	ans += len(a) - maa
	print (ans)
	exit()
maa2 = aa.most_common()[1][1]
mbb2 = bb.most_common()[1][1]
if yousoa == yousob:
	ans = min(n//2-maa + n//2-mbb2,n//2-maa2 + n//2-mbb)
	print (ans)
else:
	print (n-maa-mbb)
n = int(input())
s = str(input())
k = int(input())
ans = ""

for l in s:
  if l != s[k]:
    l = "*"
  ans += l
print(ans)
  

### FIXED CODE ###

n = int(input())
s = str(input())
k = int(input())
ans = ""

for l in s:
  if l != s[k-1]:
    l = "*"
  ans += l
print(ans)
n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k+1):
    temp=1
    temp=lst_1[i+k]/lst_1[i]
    lst_2.append(temp)
for i in range(len(lst_2)-1):
    if lst_2[i]<lst_2[i+1]:
        print("Yes")
    else:print("No")


### FIXED CODE ###

n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k):
    temp=1
    temp=lst_1[i+k]/lst_1[i]
    lst_2.append(temp)
for i in lst_2:
    if i>1:
        print("Yes")
    else:print("No")
N=int(input())
from collections import Counter,defaultdict
s=input()
ddict=defaultdict(int)
for c in s:
  ddict[c]+=1
for i in range(N-1):
  s=input()
  cnt=Counter[s]
  for k in cnt.keys():
    ddict[k]=min(ddict[k],cnt[k])
ans=""
for k in range(26):    
  c =chr(ord("a")+k)
  ans+=c*ddict[c]
print(ans)
  

### FIXED CODE ###

N=int(input())
from collections import Counter,defaultdict
s=input()
ddict=defaultdict(int)
for c in s:
  ddict[c]+=1
for i in range(N-1):
  s=input()
  cnt=Counter(s)
  for k in cnt.keys():
    ddict[k]=min(ddict[k],cnt[k])
  for k in ddict.keys():
    if not k in cnt.keys():
      ddict[k]=0
ans=""
for k in range(26):    
  c =chr(ord("a")+k)
  ans+=c*ddict[c]
print(ans)
S = input()
B = defaultdict(int)
B[0]=1
ans=0

for i in range(len(S)):
    m=int(S[-i-1:])%2019
    ans+=B[m]
    B[m]+=1

print(int(ans))

### FIXED CODE ###

from collections import defaultdict

S = input()
B = defaultdict(int)
B[0]=1
ans=0
prev=0

for i in range(len(S)):
    m=(prev+int(S[-i-1])*pow(10,i,2019))%2019
    ans+=B[m]
    B[m]+=1
    prev=m

print(int(ans))
s = input()
k = int(input())
arr = set()
arr.add(s)
for i in range(len(s)-1):
    for j in range(1, len(s)):
        arr.add(s[j:j+i+1])
arr = list(arr)
arr.sort()
print(arr[k-1])


### FIXED CODE ###

s = input()
k = int(input())
arr = set()
arr.add(s)
for i in range(len(s)-1):
    if i > 5:
        break
    for j in range(0, len(s)):
        arr.add(s[j:j+i+1])

arr = list(arr)
arr.sort()
print(arr[k-1])
A, B, T = input().split()
print(int(T/A)*B)

### FIXED CODE ###

A, B, T = map(int, input().split())
print(int(T/A)*B)
x = int(input())
print(max([i**j for i in range(1, int(x**0.5) + 1) for j in range(2, min(10, x + 1)) if i**j <= x]))

### FIXED CODE ###

x = int(input())
max_pow = []
for i in range(2, int(x**0.5) + 1):
    j = 2
    while i**j <= x:
        j += 1
    max_pow.append(i**(j - 1))
print(1 if x == 1 else max(max_pow))
def g_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return g_c_d(y, x % y)


def l_c_m(x, y):
    return x * y // g_c_d(x, y)


a, b = map(int, input().split())
c = input()
d = input()
f = l_c_m(a, b)
e = [""] * f
for i in range(0, f):
    if i * f // a > f - 1:
        break
    if e[i * f // a] == "":
        e[i * f // a] = c[i]
    elif e[i * f // a] != c[i]:
        print(-1)
        exit()
    if i * f // b > f - 1:
        break
    if e[i * f // b] == "":
        e[i * f // b] = d[i]
    elif e[i * f // b] != d[i]:
        print(-1)
        exit()
print(f)


### FIXED CODE ###

def g_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return g_c_d(y, x % y)


def l_c_m(x, y):
    return x * y // g_c_d(x, y)


a, b = map(int, input().split())
c = input()
d = input()
lcm = l_c_m(a, b)
gcd = g_c_d(a, b)
for i in range(0, gcd):
    if c[i * a // gcd] != d[i * b // gcd]:
        print(-1)
        exit()
print(lcm)
while true:
    
    ary = list(map(int, input().split()))
    
    if ary[0]+ary[1] == 0 :
        break
    
    ary.sort()

    print(ary[0], ary[1])






### FIXED CODE ###

while True:
    
    ary = list(map(int, input().split()))
    
    if ary[0]+ary[1] == 0 :
        break
    
    ary.sort()

    print(ary[0], ary[1])
MOD = 10**9+7
n = int(input())
A = list(map(int, input().split()))

colors = [0]*3
dp = [0]*n
for i in range(n):
    c = colors.count(A[i])
    dp[i] = c
    colors[colors.index(A[i])] += 1
ans = 1
for x in dp:
    ans = ans*x % MOD
print(ans % MOD)


### FIXED CODE ###

MOD = 10**9+7
n = int(input())
A = list(map(int, input().split()))

colors = [0]*3
dp = [0]*n
for i in range(n):
    c = colors.count(A[i])
    dp[i] = c
    if c == 0:
        break
    colors[colors.index(A[i])] += 1

ans = 1
for x in dp:
    ans = ans*x % MOD
print(ans % MOD)
n, t = map(int, input().split())
ti = map(int, input().split())
ttl = t
for i in range(n-1):
    ttl += min(ti[i+1]-ti[i], t)
print(ttl)

### FIXED CODE ###

n, t = map(int, input().split())
ti = list(map(int, input().split()))
ttl = t
for i in range(n-1):
    ttl += min(ti[i+1]-ti[i], t)
print(ttl)
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

else:
    printint((R + 100(10 - N)))
    

### FIXED CODE ###

l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

elif N < 10:
    print((R + 100 * (10 - N)))
def read_ints(row):
    return list(map(int, row().split()))
  
row = stdin.readline
N,M = read_ints(row)
print(N == M)

### FIXED CODE ###

def read_ints(row):
    return list(map(int, row().split()))
  
import sys
 
row =sys.stdin.readline
N,M = read_ints(row)
print("Yes" if N == M else "No")