Harryxun/stf_run huggingface dataset:
3 3 10
60 2 2 4
70 8 7 9
50 2 3 9

### FIXED CODE ###

n,m,x=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
ans=1e15
for f in range(1<<n):
  p,c=[0]*m,0
  for i in range(n):
    if f%2:
      p=list(map(lambda x,y:x+y,p,a[i][1:]))
      c+=a[i][0]
    f//=2
  if all(p[i]>=x for i in range(m)):
    ans=min(ans,c)
print(-1 if ans>=1e15 else ans)
n = int(raw_input())
S = map(int,raw_input().split())
q = int(raw_input())
T = map(int,raw_input().split())
ans = 0
for i in q:
	if i in n:
		ans += 1
print ans

### FIXED CODE ###

n = int(raw_input())
S = map(int,raw_input().split())
q = int(raw_input())
T = map(int,raw_input().split())
ans = 0
for i in T:
	if i in S:
		ans += 1
print ans
inputs = input()
a, b, c = inputs.split()
if a == b and b == c:
  return 'YES'
else:
  return 'No'

### FIXED CODE ###

x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])

if a == b and b == c:
    print('Yes')
else:
    print('No')
import math
x1,y1,x2,y2 = map(int,input().split())
print('{0:.5f}'.format(math.sqrt((x2-x1)**2+(y2-y1)**2)))



### FIXED CODE ###

import math
x1,y1,x2,y2 = map(float,input().split())
print('{0:.5f}'.format(math.sqrt((x2-x1)**2+(y2-y1)**2)))
N = int(input())
A = [int(_) for _ in input().split()]
dp = []
ans = 1
for a in A:
    N = len(dp)
    if N < a:
        dp += [0] * (a - N)
    else:
        flag = True
        for i in range(N - 1, -1, -1):
            if dp[i] < ans:
                dp[i] += 1
                flag = False
                break
        if flag:
            ans += 1
            dp = [ans] + [0] * (a - 1)
print(ans)


### FIXED CODE ###

import random
input()
A = [int(_) for _ in input().split()]
A = [A[0]] + [j for i, j in zip(A, A[1:]) if i >= j]
N = len(A)


def cut(array, index):
    if index < 1:
        return []
    if index <= array[0][0]:
        return [(index, array[0][1])]
    for _ in range(len(array)-1, 0, -1):
        if array[_ - 1][0] < index:
            return array[:_] + [(index, array[_][1])]


def is_possible(K):
    dp = [(A[0], 0)]
    for a in A[1:]:
        if a <= dp[-1][0]:
            dp = cut(dp, a)
        else:
            dp += [(a, 0)]
        is_added = False
        for j in range(len(dp) - 1, -1, -1):
            if dp[j][1] < K - 1:
                dp = cut(dp, dp[j][0] - 1) + [(dp[j][0], dp[j][1] + 1)]
                if dp[-1][0] < a:
                    dp += [(a, 0)]
                is_added = True
                break
        if not is_added:
            return False
    return True


def bis(x, y):
    if y == x + 1:
        return y
    elif is_possible((x + y) // 2):
        return bis(x, (x + y) // 2)
    else:
        return bis((x + y) // 2, y)


print(bis(0, N))
n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res

for j in range(q):
    if solve(0, mi):
        print("yes")
    else:
        print("no")

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())
t = {}

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    if (i,m) in t:
        return t[(i,m)]
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    t[(i,m)] = res
    return res

for m in mi:
    if solve(0, m):
        print("yes")
    else:
        print("no")
MOD = 998244353
N = int(input())
D = list(map(int,input().split()))
ans = [0]*N
for i in D:
    ans[i] += 1
ret = 1
for i in range(1,max(D)+1):
    ret *= pow(ans[i-1],ans[i],MOD)
    ret %= MOD
if ans[0] == 1:
    print(ret)
else:
    print(1/0)

### FIXED CODE ###

MOD = 998244353
N = int(input())
D = list(map(int,input().split()))
ans = [0]*N
for i in D:
    ans[i] += 1
ret = 1
for i in range(1,max(D)+1):
    ret *= (ans[i-1] ** ans[i])%MOD
    ret %= MOD
if ans[0] == 1 and D[0] == 0:
    print(ret)
else:
    print(0)
n = int(input())
a = list(map(int, input().split()))
x = 1
for i in range(n):
  x *= a[i] 
if x > 1000000000000000001:
  x = -1
print(x)


### FIXED CODE ###

i = list(map(int, input().split()))
print(i[0]*i[1])
a = int(input())
b = int(input())

print(a*b)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
import fractions
nm=raw_input()
nm=nm.split()
n=eval(nm[0])
m=eval(nm[1])
s=raw_input()
t=raw_input()

gg=fractions.gcd(n,m)

result = ll
for i in xrange(n):
    if not (i*m) % n :
            tmp=i*m/n
            if s[i] != t[tmp] :
                result= -1
print result

### FIXED CODE ###

import fractions
nm=raw_input()
nm=nm.split()
n=eval(nm[0])
m=eval(nm[1])
s=raw_input()
t=raw_input()

gg=fractions.gcd(n,m)
ll=n/gg*m
result = ll
for i in xrange(n):
    if not (i*m) % n :
            tmp=i*m/n
            if s[i] != t[tmp] :
                result= -1
print result
import math
n = math.factorial(int(input()))
mod = 10**9+7
#print(n)
def div(n):
  di = []
  for i in range(1,int(n**0.5)+1):
    if n % i == 0:
      di.append(i)
      if i != n//i:
        di.append(n//i)
  return di
print(len(div(n))%mod)

### FIXED CODE ###

n = int(input())
t = [0]*n
f = 1
mod = 10**9+7
for i in range(2,n+1):
  fa = 1
  while i > 1:
    fa += 1
    while i % fa == 0:
      i = i//fa
      t[fa-2] += 1

for j in range(n):
  f = f*(t[j]+1)%mod
print(f)
a,b,c = int(input(),input(),input()).split()
if(a + b + c)==17:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c = list(map(int,input().split()))
if(a + b + c)==17:
  print("YES")
else:
  print("NO")
#!/usr/bin/env python3
import sys


def solve(H: int, W: int, c: "List[List[int]]", A: "List[List[int]]"):
    #print(*c, sep='\n')
    for k in range(10):
        for i in range(10):
            for j in range(10):
                c[i][j] = min(c[i][j], c[i][k]+c[k][j])
    #print(*c, sep='\n')
    cost = 0
    for a in A:
        for aa in a:
            if aa == -1:
                continue
            cost += c[aa][1]
    return cost


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    c = [[int(next(tokens)) for _ in range(9 - 0 + 1)] for _ in range(9 - 0 + 1)]  # type: "List[List[int]]"
    A = [[int(next(tokens)) for _ in range(W)] for _ in range(H)]  # type: "List[List[int]]"
    print(solve(H, W, c, A))

def test():
    import doctest
    doctest.testmod()

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


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(H: int, W: int, c: "List[List[int]]", A: "List[List[int]]"):
    #print(*c, sep='\n')
    for _ in range(10):
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    c[i][j] = min(c[i][j], c[i][k]+c[k][j])
    #print(*c, sep='\n')
    cost = 0
    for a in A:
        for aa in a:
            if aa == -1:
                continue
            cost += c[aa][1]
    return cost


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    c = [[int(next(tokens)) for _ in range(9 - 0 + 1)] for _ in range(9 - 0 + 1)]  # type: "List[List[int]]"
    A = [[int(next(tokens)) for _ in range(W)] for _ in range(H)]  # type: "List[List[int]]"
    print(solve(H, W, c, A))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
l, r = map(int, input().split())
num = 2019
if (l<=673<=r and r-l>=3) or (r-l>=673):
  print(0)
else:
  mods = []
  for i in range(l, r):
    for j in range(i+1, r+1):
      m = (i*j) % num
      mods.append(m)
      if m == 1:
        print(1)
        exit()
print(min(mods))

### FIXED CODE ###

l, r = map(int, input().split())
ans = 2019
for i in range(l, r):
  for j in range(i+1, r+1):
    tmp = i*j % 2019
    if ans > tmp:
      ans = tmp
    if ans == 0:
      print(ans)
      exit()
print(ans)
import fractions

N = int(input())
if N % 2 == 1:
  print(0)
else:
  ans = 0
  log = int(fractions.math.log(N//2,5))
  for l in range(1,log+1):
    power = 5**l
    ans += (N//2) // power
  print(ans)

### FIXED CODE ###

import fractions


N = int(input())
if N == 0:
  print(0)
elif N % 2 == 1:
  print(0)
else:
  ans = 0
  log = int(fractions.math.log(N//2,5))
  for l in range(1,log+1):
    power = 5**l
    ans += (N//2) // power
  print(ans)
import math
N = int(input())
T = [int(input()) for _ in range(N)]

for i in range(N-1):
   T[i+1] = (T[i] * T[i+1]) // math.gcd(T[i], T[i+1])
print(T[-1])

### FIXED CODE ###

def gcd(x,y):
    z = x % y
    if z == 0:
        return y
    return gcd(y, z)

N = int(input())
T = [int(input()) for _ in range(N)]

for i in range(N-1):
   T[i+1] = (T[i] * T[i+1]) // gcd(T[i], T[i+1])
print(T[-1])
import functools

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


total_votes_checker = lambda M, total_votes: (False 
                                        if total_votes < 1 / (4 * M) 
                                        else True)

total_votes = sum(A)

#item_num_checker = lambda N, A: True if len(A) == N else False

popular_checker = lambda A, M: True if A[M] == max(A) else False

total_votes_checker(M, total_votes)
popular_checker(A,M)

TF = total_votes_checker(M, total_votes) and popular_checker(A,M)

printer = lambda TF : print("yes") if True else print("No")

printer(TF)

### FIXED CODE ###

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

total_votes = sum(A)

total_votes_checker = lambda M, i, total_votes: (False if i < (1 / (4 * M)) * total_votes else True)

A = list(filter(lambda i: total_votes_checker(M, i, total_votes), A))

print("Yes") if len(A) >= M else print("No")
import numpy as np
import math
n = int(input())
l = np.empty(floor(n ** 0.5))
l = np.nan

k = 0
for i in range(floor(n ** 0.5)):
  if n % i == 0:
    l[k] = i + n // i - 2
    k += 1
print(int(np.nanmin(l)))

### FIXED CODE ###

n = int(input())

for i in range(int(n ** 0.5)):
  if n % (int(n ** 0.5) - i) == 0:
    j = n // (int(n ** 0.5) - i)
    break
    
print(int(n ** 0.5) - i + j - 2)
n=int(input())
S=[]
for i in range(n):
    S.append(input())

from collections import defaultdict
d = defaultdict(lambda:0)

for k in S:
    d[str(k)]+=1

ansn=max(d.values())
ans=[]
for i in set(S):
    if d[i]==ansn:
        ans.append(i)

ans=sorted(ans)
for i in range(len(ans)):
    print(ans[i])


### FIXED CODE ###

a,b,c=map(int, input().split())  
x=len(set([a,b,c]))
if x==2:
    print('Yes')
else:
    print('No')
import math
n,k = map(int,input().split())
sum = 0
for i in range(1,n+1):
  point = i
  if point <= k-1:
    s = math.log2(k/i)
    if s == int(s):
      sum += (1/2)**(int(s))
    else:
      sum += (1/2)**(int(s)+1)
  else:sum += 1
print(round(sum/n,10)-10**(-10))

### FIXED CODE ###

import math
n,k = map(int,input().split())
sumlist = []
for i in range(1,n+1):
  point = i
  if point <= k-1:
    s = math.log(k/i,2)
    if s == int(s):
      sumlist.append((1/2)**(int(s)))
    else:
      sumlist.append((1/2)**(int(s)+1))
  else:sumlist.append(1)
print(round(sum(sumlist)/n,10)-10**(-10))
n=int(input())

if n%2==0 print(1/2) else print((n+1)/2/n)

### FIXED CODE ###

n=int(input())

if n%2==0:
  print(1/2)
else:
  print((n+1)/2/n)
class RSQ:
    def __init__(self, length, ini_num = float("inf")):
        self.length = 1
        self.ini_num = ini_num
        while self.length < length:
            self.length <<= 1
        self.segtree = [ini_num] * (2 * self.length - 1)

    def update(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] = num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]
            
    def add(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] += num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def call_search(self, a, b):
        return self.search(a, b, index = 0, l = 0, r = self.length - 1)

    def search(self, a, b, index, l, r):
        if a <= l <= r <= b:
            return self.segtree[index]
        elif r < a or b < l:
            return self.ini_num
        else:
            return self.search(a, b, index * 2 + 1, l, (l + r) // 2) + self.search(a, b, index * 2 + 2, (l + r) // 2 + 1, r)

v_num, query = map(int, input().split(" "))
rsq = RSQ(v_num, 0)
for _ in range(query):
    comm, index, num = map(int, input().split(" "))
    if comm == 0:
        rsq.add(index, num)
    else:
        print(rsq.call_search(index, num))

### FIXED CODE ###

class RSQ:
    def __init__(self, length, ini_num = float("inf")):
        self.length = 1
        self.ini_num = ini_num
        if length == 1:
            length = 2
        while self.length < length:
            self.length <<= 1
        self.segtree = [ini_num] * (2 * self.length - 1)

    def update(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] = num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def add(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] += num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def call_search(self, a, b):
        return self.search(a, b, index = 0, l = 0, r = self.length - 1)

    def search(self, a, b, index, l, r):
        if r < a or b < l:
            return self.ini_num            
        elif a <= l <= r <= b:
            return self.segtree[index]
        else:
            return self.search(a, b, index * 2 + 1, l, (l + r) // 2) + self.search(a, b, index * 2 + 2, (l + r) // 2 + 1, r)

v_num, query = map(int, input().split(" "))
rsq = RSQ(v_num, 0)
for _ in range(query):
    comm, index, num = map(int, input().split(" "))
    if comm == 0:
        rsq.add(index - 1, num)
    else:
        print(rsq.call_search(index - 1, num - 1))
n,m=map(int,input().split())
visit=[0]*n
B=[list() for _ in range(n)]
for _ in range(m):
  a,b=map(int,input().split())
  visit[a-1]+=1
  B[b-1].append(a)
dp=[0]*n
from collections import deque
for i in range(n):
  if visit[i]==0:
    d=deque()
    d.append(i+1)
    while d:
      now=d.pop()
      for j in B[now-1]:
        d.append(j)
        dp[j-1]=max(dp[j-1],dp[now-1]+1)
print(max(dp))        
   


### FIXED CODE ###

n=int(input())
dp=[0]*n
h=list(map(int,input().split()))
for i in range(1,n):
  if i-2>=0:
     dp[i]=min(dp[i-1]+max(h[i]-h[i-1],h[i-1]-h[i]),dp[i-2]+max(h[i]-h[i-2],h[i-2]-h[i]))
  else:
    dp[i]=dp[i-1]+max(h[i]-h[i-1],h[i-1]-h[i])
print(dp[n-1])
N, K = map(int, input().split())
S = list(input())
l = len(S)
X = []
cnt0 = 0
cnt1 = 0
for i in S:
    if i == '0':
        if cnt1 != 0:
            X.append(cnt1)
            cnt1 = 0
            cnt0 += 1
        else:
            cnt0 += 1
    else:
        if cnt0 != 0:
            X.append(cnt0)
            cnt0 = 0
            cnt1 += 1
        else:
            cnt1 += 1
if cnt1 != 0:
    X.append(cnt1)
elif cnt0 != 0:
    X.append(cnt0)
ans = []
if S[0] == '1': #Xの奇数は1
    sum0 = sum(X[0:2*K+1])
    ans.append(sum0)
    i = 1
    while 2*K+2*i-1 < len(X):
        ans.append(ans[i-1] + X[2*K+2*i-1] + X[2*K+2*i] - X[i] - X[i-1])
        i += 1
else:
    sum0 = sum(X[0:2*K])
    ans.append(sum0)
    i = 1
    while 2*K+2*i <= len(X):
        if i == 1:
            ans.append(ans[i-1] + X[2*K+2*i-2] + X[2*K+2*i-1] - X[i-1])
            i += 1
        else:
            ans.append(ans[i-1] + X[2*K+2*i-2] + X[2*K+2*i-1] - X[i] - X[i-1])
            i += 1
print(max(ans))

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
X = []
cnt = 1
for i in range(1, N):
    if S[i] != S[i-1]:
        X.append(cnt)
        cnt = 0
    cnt += 1
    if i == N-1:
        X.append(cnt)
l = len(X)

if S[0] == '0' and (l+1)//2 <= K:
    print(N)
    exit()
if S[0] ==  '1' and l//2 <= K:
    print(N)
    exit()

ans = 0
result = 0
if S[0] == '0':
    for j in range(2*K):
        result += X[j]
    ans = result
    for j in range(2*K, l):
        if j == 2*K:
            result -= X[0]
        elif j%2 == 0:
            result = result - X[j-2*K] - X[j-2*K-1]
        result += X[j]
        ans = max(ans,result)
else:
    for j in range(2*K+1):
        result += X[j]
    ans = result
    for j in range(2*K+1, l):
        if j%2 == 1:
            result = result - X[j-2*K-1] - X[j -2*K]
        result += X[j]
        ans = max(ans, result)
print(ans)
import fractions


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


N = int(input())
t1 = int(input())
t2 = int(input())
t = lcm(t1, t2)
for _ in range(2, N):
    t = lcm(t, int(input()))
print(t)


### FIXED CODE ###

import fractions


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


N = int(input())
if N == 1:
    print(input())
else:
    t1 = int(input())
    t2 = int(input())
    t = lcm(t1, t2)
    for _ in range(2, N):
        t = lcm(t, int(input()))
    print(t)
N=int(input())
h=list(map(int,input().split()))

INF=float("inf")

DP=[INF]*(N+1)

def rec(n):
    if DP[n]<INF: return DP[n]
    if n==0:
        return 0
    ans=INF
    ans=min(ans,rec(n-1)+abs(h[n]-h[n-1]))
    if n>1:
        ans=min(ans,rec(n-2)+abs(h[n]-h[n-2]))
    DP[n]=ans

    return DP[n]

ans=rec(N-1)
print(ans)


### FIXED CODE ###

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

DP=[100000]*N

DP[0]=0
DP[1]=abs(h[1]-h[0])

for i in range(2,N):
    DP[i]=min(DP[i-2]+abs(h[i]-h[i-2]),DP[i-1]+abs(h[i]-h[i-1]))

print(DP[N-1])
S = int(input())

h = S // 3600
m = S % 3600 // 60
s = S % 60

print(h, m, s, cep=':')

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60
print(h, m, s, sep=':')
n,m=map(int,input().split())
ab=[map(int,input().split()) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
print(b-a+1)

### FIXED CODE ###

n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
if b-a+1<0:print(0)
else:print(b-a+1)
N = int(input())
H=list(map(int,input().split()))
INF=1000000000
dp=[INF]*(N+1)
dp[0]=0
for i in range(1,N):
  if i==1:
    dp[i]=dp[i-1]+abs(H[i]-H[i-1])
  else:
    dp[i]=min(dp[i-2]+abs(H[i-2]-H[i]),dp[i-1]+abs(H[i-1]-H[i]))
print(dp[N-1])

### FIXED CODE ###

N,K=map(int,input().split())
h=[int(i) for i in input().split()]
f_inf=float('inf')
dp=[f_inf]*(N+10)
dp[0]=0
for i in range(1,N):
  for j in range(1,K+1):
    if i-j>=0:
      dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[N-1])
import math
n,a,b,k=map(int,input().split())
def gcd(x,y):
  if y==0:
    return x
  else:
    return gcd(y,x%y)
p=gcd(a,b)
ans=0
for i in range(k//(a+b)):
  if (k-(a+b)*i)%p!=0:
    continue
  else:
    q=gcd(p,k-(a+b)*i)
    A=a//q
    B=b//q
    K=k//q
    A_=(pow(A,B-2,B)*K)%p
    for i in range((n-i-A_)//B):
      ans+=math.factorial(n-i)//(math.factorial(A_+B*i)*math.factorial((k-A_+B*i)//B)*math.factorial(n-i-A_+B*i-(k-A_+B*i)//B))
print(ans)

### FIXED CODE ###

n,a,b,k=map(int,input().split())
p=998244353
def getinv(n):
  inv=[0]*(n+1)
  inv[1]=1
  for i in range(2,n+1):
    inv[i]=(-(p//i)*inv[p%i])%p
  return inv
def getnCr(n):
  inv=getinv(n)
  nCr=[0]*(n+1)
  nCr[0]=1
  for i in range(1,n+1):
    nCr[i]=(nCr[i-1]*(n-i+1)*inv[i])%p
  return nCr
def solve(n,a,b,k):
  ans=0
  nCr=getnCr(n)
  for i in range(n+1):
    if (k-a*i)<0 or (k-a*i)%b!=0:
      continue
    j=(k-a*i)//b
    if a*i+b*j==k and 0<=j<=n:
      ans+= nCr[i]*nCr[j]
      ans%=p
  return ans
print(solve(n,a,b,k))
a,b=map(str,input().split())
if int(a)<=int(b):
  s=a
  for i in range(b-1):
    s+=a
  print (s)
else:
  s=b
  for j in range(a-1):
    s+=b
  print(s)
  


### FIXED CODE ###

a,b=map(str,input().split())
if int(a)<=int(b):
  s=a
  for i in range(int(b)-1):
    s+=a
  print (s)
else:
  s=b
  for j in range(int(a)-1):
    s+=b
  print(s)
n = int(input())
d = list(map(int,input().split()))
p = 0
q = 0
m = 0
d.sort()
if (len(d))%2 == 0:
  m = ((d[(len(d)/2)-1])+(d[len(d)/2]))/2
else:
  m = d[(len(d)/2)]
for i in range(len(d)):
  if d[i]>=m:
    if d[i] == d[i+1]:
      break
    else:
      p = d[i]
      q = d[i-1]
      break
print(p-q)

### FIXED CODE ###

n = int(input())
d = sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])
n = int(raw_input())
a = map(int, raw_input().split())
print (" ".join(map(str, a.reverse())))

### FIXED CODE ###

n = int(raw_input())
a = map(int, raw_input().split())
a.reverse()
print (" ".join(map(str, a)))
x,n = map(int, input().split())
p = sorted(map(int, input().split()))
if p == []:
    print(x)
else:
    a = p[-1]
    d =[]
    D =[]
    e = 1
    E = 0
    b = 1000
    c = 0
    for i in range(a):
        d += [e]
        e += 1
    for i in range(n):
        d.remove(p[E])
        E += 1
    for i in range(n):
        b = min(abs(x-d[c]),b)
        c += 1
    if (x-b) in d:
        print(x-b)
    else:
        print(x+b)

### FIXED CODE ###

x,n = map(int, input().split())
p = set(map(int, input().split()))
for i in range(101):
    if x-i not in p:
        print(x-i)
        break
    if x+i not in p:
        print(x+i)
        break
# A - Darker and Darker
import numpy as np

H,W = map(int,input().split())
h,w = np.arange(H,dtype=int),np.arange(W,dtype=int)
A = [list(input()) for _ in range(H)]

queue,new_queue = [],[]

for i in h:
    for j in w:
        if A[i][j]=='#':
            queue.append((i,j))
            
def darker(i,j):
    if A[i][j]=='.' and (i in h) and (j in w):
        A[i][j]='#'
        new_queue.append((i,j))

ans = 0

while True:
    new_queue = []
    for i,j in queue:
        darker(i-1,j)
        darker(i+1,j)
        darker(i,j-1)
        darker(i,j+1)
    if new_queue==[]:
        break
    ans += 1
    queue = new_queue 

print(ans)

### FIXED CODE ###

# A - Darker and Darker
from collections import deque

H,W = map(int,input().split())
B = [[-1] * W for _ in range(H)]

queue = deque([])

for i in range(H):
    A = input()
    for j in range(W):
        if A[j]=='#':
            B[i][j] = 0
            queue.append((i,j))

ans = 0

while queue:
    I,J = queue.popleft()
    for di,dj in ((-1,0),(1,0),(0,-1),(0,1)):
        i,j = I+di,J+dj
        if 0<=i<H and 0<=j<W:
            if B[i][j]<0:
                B[i][j] = B[I][J]+1
                ans = max(ans,B[i][j])
                queue.append((i,j))

print(ans)
import math
a, b = map(int, input().split())
c = math.gcd(a, b)
print(int(a * b / c))

### FIXED CODE ###

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

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
	
def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(a, b))