Harryxun/stf_run huggingface dataset:
import math

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

### FIXED CODE ###

from fractions import gcd
a, b = map(int, input().split())
print(int(a * b / gcd(a, b)))
memo = [0]*10**6 #i番目の数列を格納するためのメモ
def fib(n):
    if n in a:
        return 0
    if n<=1:
        return 1 #0,1番目の数列はo,1
    if memo[n] != 0:
        return memo[n] #i番目の数列がmemoにある場合それを返す
    memo[n] = fib(n-1) + fib(n-2) #i番目の数列の計算
    return memo[n]

print(fib(i)%1000000007)


### FIXED CODE ###

n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])
K,N=map(int,input().split())
A=list(map(int,input().split()))
d=0
for i in range(N-1):
  if d == 0 and A[i+1]-A[0] >= K/2:
    d=d+A[i]-A[0]+K-A[i+1]
if d == 0:
  d=d+A[N-1]-A[N-2]
print(d)

### FIXED CODE ###

S=input()
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
# 明らかにdp、あるマスに乗っているときそれまでの履歴とかが全く意味をなさないから
# dp[i]: マス目iにいるときのそこまでの移動方法の合計
# dp[i+1] = dp[i]
# 最悪N*K掛かりそうな気がするけどnumpyなら早いんかなぁ？だとしたら簡単すぎる問題な気もするけど。。。？

N,K = map(int,input().split())
L = 998244353
LR = [0] * K
for i in range(K):
    l,r = map(int,input().split())
    LR[i] = [l,r]
import numpy as np
dp = np.array([0] * (N+1))

dp[1] = 1
for i in range(1,N+1):
    for l,r in LR:
        dp[i+l:i+r+1] += dp[i]
        dp[i+l:i+r+1] %= L

print(dp[N])





### FIXED CODE ###

N,K = map(int,input().split())
L = 998244353
LR = [0] * K
# 累積和をとっていく。累積和の表を予め作っておき、どんどん足しておく
for i in range(K):
    l,r = map(int,input().split())
    LR[i] = [l,r]

AS = [0] * (N+2)
#for l,r in LR:
#    AS[l] += 1
#    AS[r+1] -= 1

A = [0] * (N+2)
A[1] = 1
A[2] = -1
for i in range(1,N+1):
    AS[i] = (AS[i-1] + A[i])%L
    rest = AS[i]
    for l,r in LR:
        if i+l>N:
            continue
        right = min(N+1,i+r+1)
        A[i+l] += rest
        A[right] += -rest

print(sum(A[1:N+1])%L)
n = map(int, input().split())
ls = list(map(int, input().split))
for i in ls:
    ls2 = ls.copy()
    ls2.remove(i)
    print(sorted(ls2)[1])

### FIXED CODE ###

n =  int(input())
ls = list(map(int, input().split()))
sorted_ls = ls.copy()
sorted_ls.sort()
f = sorted_ls[int(n/2)]
b = sorted_ls[int(n/2)-1]

for i in ls:
    if i < f:
        print(f)
    else:
        print(b)
N = int(input())

if N==2:
    print(3,5)
    exit()
if N==3:
    print(2,5,63)
    exit()
if N==4:
    print(2,5,20,63)
    exit()

S=set()
i=2
while len(S)<N:
    if i%2==0 or i%3==0:
        S.add(i)
    i+=1

i+=1
r=sum(S)

if r%6==0:
    pass
elif r%6==2:
    S.remove(8)
    while len(S)<N:
        if i%6==0:
            S.add(i)
            break
        i+=1
elif r%6==3:
    S.remove(9)
    while len(S)<N:
        if i%6==0:
            S.add(i)
            break
        i+=1
elif r%6==5:
    S.remove(9)
    while len(S)<N:
        if i%6==4:
            S.add(i)
            break
        i+=1

assert len(S)==N,len(S)
print(" ".join(map(str,S)))


### FIXED CODE ###

N = int(input())

if N==2:
    print(3,5)
    exit()
if N==3:
    print(2,5,63)
    exit()
if N==4:
    print(2,5,20,63)
    exit()

if N==5:
    print(2,5,20,30,63)
    exit()

S=set()
i=2
while len(S)<N:
    if i%2==0 or i%3==0:
        S.add(i)
    i+=1

i+=1
r=sum(S)

if r%6==0:
    pass
elif r%6==2:
    S.remove(8)
    while len(S)<N:
        if i%6==0:
            S.add(i)
            break
        i+=1
elif r%6==3:
    S.remove(9)
    while len(S)<N:
        if i%6==0:
            S.add(i)
            break
        i+=1
elif r%6==5:
    S.remove(9)
    while len(S)<N:
        if i%6==4:
            S.add(i)
            break
        i+=1

assert len(S)==N,len(S)
print(" ".join(map(str,S)))
from math import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())
a = [int(_) for _ in input().split()]
a.sort()
ir = [a[0]]
for i in range(1,n):
    ir.append(gcd(a[0], a[i]))
mi = ir.index(min(ir))
mr = []
for i in range(n):
    mr.append(gcd(a[mi], a[i]))
if ir.count(min(ir)) > mr.count(min(mr)):
    print(gcd_list(a[1::]))
elif ir.count(min(ir)) == mr.count(min(mr)):
    print(a[0])
elif ir.count(min(ir)) < mr.count(min(mr)):
    b = a[:mi] + a[mi+1:]
    print(gcd_list(b))


### FIXED CODE ###

import math
def get_div_list(num):
    if num == 1:
        return [1]
    else:
        div_list = []
        div_list.append(1)
        div_list.append(num)
        for i in range(2, math.floor(math.sqrt(num))+ 1):
            if num % i == 0:
                div_list.append(i)
                div_list.append(num // i)
        list(set(div_list))
        div_list.sort(reverse = True)
        return div_list
n = int(input())
a = [int(_) for _ in input().split()]
d = sorted(list(set(get_div_list(a[0])+get_div_list(a[1]))))[::-1]
for i in range(len(d)):
    cnt = 0
    for j in range(n):
        if a[j]%d[i]==0:cnt+=1
    if cnt >= n-1:
        print(d[i])
        break
A,B=map(int,input().split()
print(max(A-2*B,0))


### FIXED CODE ###

A,B=map(int,input().split())
print(max(A-2*B,0))
n,a,b=map(int,input().split())

tmp1,tmp2=divmod(n,a+b)

blue=tmp1*a
if(tmp2>a):
  blue=blue+a
else:
  blue=blue+tmp2
  
print(blue)

### FIXED CODE ###

S=list(input())

if(S[0]==S[1] and S[1]==S[2]):
  print("No")
  
else:
  print("Yes")
S = int(input:)
h = S / 3600
m = (S % 3600) / 60
s = (S % 3600) % 60
print(h, m, s)

### FIXED CODE ###

S = int(input())
h = S // 60 //60
m = S // 60 % 60
s = S % 60
print("{0}:{1}:{2}".format(h,m,s))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
M = int(input())
C = [list(map(int,input().split())) for _ in range(M)]
ans = min(A) + min(B)
for cp in C:
    temp = A[cp[0]-1] + B[cp[1]-1] + cp[2]
    ans = min(ans,temp)
    
print(ans)

### FIXED CODE ###

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

B = list(map(int,input().split()))
C = [list(map(int,input().split())) for _ in range(M)]
ans = min(A) + min(B)
for cp in C:
    temp = A[cp[0]-1] + B[cp[1]-1] - cp[2]
    ans = min(ans,temp)

print(ans)
N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")

### FIXED CODE ###

N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if Y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")
def modpow(a, b, mod=1):
    ret = 1
    while b > 0:
        if b % 2 == 1:
            ret = ret * a % mod
        a, b = a * a % mod, b // 2
    return ret


MOD = 10 ** 9 + 7
X, Y = map(int, input().split())
A, B = (2 * X - Y) // 3, (2 * Y - X) // 3
if (X + Y) % 3 != 0 or A < 0 or B < 0:
    print(0)
else:
    ans = 1
    for n in range(A + B, A, -1):
        ans = ans * n % MOD
    for n in range(1, B + 1):
        ans = ans * modpow(n, MOD - 2, MOD) % MOD

print(ans)


### FIXED CODE ###

MOD = 10 ** 9 + 7


def modpow(a, b, mod):
    ret = 1
    while b > 0:
        if b % 2 == 1:
            ret = ret * a % mod
        a = a * a % mod
        b //= 2
    return ret


X, Y = map(int, input().split())
if (2 * X - Y) % 3 != 0 or (2 * Y - X) % 3 != 0:
    print(0)
elif (2 * X - Y) // 3 < 0 or (2 * Y - X) // 3 < 0:
    print(0)
else:
    A, B = (2 * X - Y) // 3, (2 * Y - X) // 3
    ans = 1
    for n in range(A + B, A, -1):
        ans = ans * n % MOD
    for n in range(1, B + 1):
        ans = ans * modpow(n, MOD - 2, MOD) % MOD
    print(ans % MOD)
input_data = raw_input().split(" ")
product = int(input_data[0])*int(input_data[2])
if (product % 2 == 0):
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a,b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
S = input()
print(700 + int(S.count() * 100))

### FIXED CODE ###

S = input()
print(700 + S.count('o') * 100)
print("YES"if input()in"357"else"NO")
print("YNEOS"[1-input()in"357"::2])

### FIXED CODE ###

print("YES"if input()in"357"else"NO")
A,B = int(input())
if (A < 10) and (B < 10):
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

A,B = map(int, open(0).read().split())
if (A < 10) and (B < 10):
  print(A*B)
else:
  print(-1)
S = [SUN,MON,TUE,WED,THU,FRI,SAT]

print(7-index(input()))

### FIXED CODE ###

S = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

print(7-S.index(input()))
def main():
    K = int(input())
    Kstr = str(K)
    
    if Kstr[-1] in ('0','2','4','6','8','5'):
        print(-1)
    else:
        if K%7 == 0:
            L = (9*K)/7
        else:
            L = 9*K
        S = 10
        for i in range(1,L):
            S = S%L
            if S == 1:
                print(i)
                break
            S = S*10
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    K = int(input())
    Kstr = str(K)
    
    if Kstr[-1] in ('0','2','4','6','8','5'):
        print(-1)
    else:
        if K%7 == 0:
            L = (9*K)/7
        else:
            L = 9*K
        S = 10
        for i in range(1,6000000):
            S = S%L
            if S == 1:
                print(i)
                break
            S = S*10
    
if __name__ == '__main__':
    main()
N = int(input())
List = [list(map(int, input().split())) for _ in range(N)]

import itertools
import collections

arr = list(itertools.combinations(List, 2))
vec = []

for i in range(len(arr)):
    vec.append([arr[i][1][0]-arr[i][0][0], arr[i][1][1]-arr[i][0][1]])

counter = collections.Counter(map(tuple, vec))
num = counter.most_common(1)[0][1]

print(N-num)

### FIXED CODE ###

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

import itertools
import collections

if N==1:
    print(1)
    
else:
    arr = list(itertools.combinations(List, 2))
    vec1 = []
    vec2 = []
    for i in range(len(arr)):
        vec1.append([arr[i][1][0]-arr[i][0][0], arr[i][1][1]-arr[i][0][1]])
        vec2.append([arr[i][0][0]-arr[i][1][0], arr[i][0][1]-arr[i][1][1]])
        
    vec = vec1+vec2
    counter = collections.Counter(map(tuple, vec))
    
    v =  counter.most_common(1)[0][0]
    num = counter.most_common(1)[0][1]
    
    print(N-num)
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def main():
    N, A, B = map(int, input().split())
    v = list(map(int, input().split()))
    sort_v = sorted(v, reverse=True)
    ave = 0
    ans = 0
    if sort_v[0] == sort_v[A-1]:
        cnt = v.count(sort_v[A-1])
        ave = sort_v[0]
        for i in range(A, min(cnt,B)+1):
            ans += cmb(cnt,i)
    else:
        cnt = v.count(sort_v[A-1])
        ind = sort_v.index(sort_v[A-1])
        for i in range(ind, A):
            ans += cmb(cnt, i)
        tmp = 0
        for i in range(A):
            tmp += sort_v[i]
        ave = tmp / A
    print(ave)
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

from math import factorial

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

def max_ave():
    N, A, B = map(int, input().split())
    v = list(map(int, input().split()))
    sort_v = sorted(v, reverse=True)

    # 平均の最大値を求める
    sum_A = 0
    for i in range(A):
        sum_A += sort_v[i]
    max_ave_v = sum_A / A

    print(max_ave_v)

    # 選び方を求める
    V = sort_v[:A]
    num = v.count(min(V))
    a = V.count(min(V))
    cnt = 0
    if max(V) == min(V):
        for i in range(A,B+1):
            if num < i:
                continue
            cnt += combinations_count(num,i)
    else:
        cnt = combinations_count(num,a)
    
    print(cnt)

max_ave()
from collections import deque, Counter


class UnionFind:
    def __init__(self, v):
        self.v = v
        self._tree = list(range(v + 1))
        self._counter = Counter(self._tree)

    def _root(self, a):
        queue = deque()
        while self._tree[a] != a:
            queue.append(a)
            a = self._tree[a]
        while queue:
            index = queue.popleft()
            self._tree[index] = a
        return a

    def union(self, a, b):
        root_a = self._root(a)
        root_b = self._root(b)
        if root_a == root_b:
            return

        self._tree[root_b] = root_a
        ca = self._counter[root_a]
        cb = self._counter[root_b]
        self._counter[root_a] += cb
        self._counter[root_b] = 0
        return ca * cb

    def find(self, a, b):
        return self._root(a) == self._root(b)


N, M = map(int, input().split(' '))
edges = [tuple(map(int, input().split(' '))) for _ in range(M)]

dp = [0] * (M + 1)
dp[-1] = N * (N - 1) // 2
union_find = UnionFind(N)

try:
    for i in reversed(range(M)):
        if dp[i + 1] == 0:
            break
        a, b = edges[i]
        minus = union_find.union(a, b)
        dp[i] = dp[i + 1] - minus

    for i in range(M):
        print(dp[i + 1])
except IndexError:
    print(-1)


### FIXED CODE ###

from collections import deque, Counter


class UnionFind:
    def __init__(self, v):
        self.v = v
        self._tree = list(range(v + 1))
        self._counter = Counter(self._tree)

    def _root(self, a):
        queue = deque()
        while self._tree[a] != a:
            queue.append(a)
            a = self._tree[a]
        while queue:
            index = queue.popleft()
            self._tree[index] = a
        return a

    def union(self, a, b):
        root_a = self._root(a)
        root_b = self._root(b)
        if root_a == root_b:
            return 0

        self._tree[root_b] = root_a
        ca = self._counter[root_a]
        cb = self._counter[root_b]
        self._counter[root_a] += cb
        self._counter[root_b] = 0
        return ca * cb

    def find(self, a, b):
        return self._root(a) == self._root(b)


N, M = map(int, input().split(' '))
edges = [tuple(map(int, input().split(' '))) for _ in range(M)]

score = N * (N - 1) // 2
union_find = UnionFind(N)
scores = []

for a, b in reversed(edges):
    scores.append(score)
    if score == 0:
        continue
    minus = union_find.union(a, b)
    score -= minus

for s in reversed(scores):
    print(s)
n, q = map(int, input().split(" "))
items = [i for i in range(n)]
parent = [i for i in range(n)]

def root(s):
    if parent[s] == s:
        return s
    else:
        parent[s] = root(parent[s])
        return parent[s]

def same(s1, s2):
    if root(s1) == root(s2):
        print("1")
    else:
        print("0")

def unite(s1, s2):
    s1 = root(s1)
    s2 = root(s2)

    if s1 == s2:
        return

    parent[s1] = s2


for i in range(q):
    query, item1, item2 = input().split(" ")
    item1, item2 = int(item1), int(item2)

    if query == "0":
        unite(item1, item2)
    else:
        same(item1, item2)

### FIXED CODE ###

n, q = map(int, input().split(" "))
parent = [i for i in range(n)]
rank = [0] * len(parent)

def root(s):
    if parent[s] == s:
        return s
    else:
        parent[s] = root(parent[s])
        return parent[s]

def same(s1, s2):
    if root(s1) == root(s2):
        print("1")
    else:
        print("0")

def unite(s1, s2):
    s1 = root(s1)
    s2 = root(s2)

    if s1 == s2:
        return

    if rank[s1] < rank[s2]:
        parent[s1] = s2
    else:
        parent[s2] = s1
        if rank[s1] == rank[s2]:
            rank[s1] += 1

for i in range(q):
    query, item1, item2 = input().split(" ")
    item1, item2 = int(item1), int(item2)

    if query == "0":
        unite(item1, item2)
    else:
        same(item1, item2)
import math

S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = int((C * D) / math.gcd(C, D))
X = (B//C)-(A//C)
Y = (B//D)-(A//D)
Z = (B//E)-(A//E)+1

print(int(B-A-X-Y+Z))


### FIXED CODE ###


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

 #最小公倍数


def lcm(a, b):
    return a*b//gcd(a, b)


S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = lcm(C, D)

X = int(B//C)-int((A-1)//C)
Y = int(B//D)-int((A-1)//D)
Z = int(B//E)-int((A-1)//E)

print(B-A+1-X-Y+Z)
mod = 10**9+7


def inv(a, mod):
    r = [1, 0, a]
    w = [0, 1, mod]
    while w[2] != 1:
        q = r[2]//w[2]
        r_new = [r[0]-q*w[0], r[1]-q*w[1], r[2]-q*w[2]]
        r = w
        w = r_new
    x, y = w[0], w[1]    # a*x+y*mod = 1
    return (mod+x % mod) % mod


max_num = 10**6+1
fact = [0 for _ in range(max_num)]
ifact = [0 for _ in range(max_num)]

fact[0] = fact[1] = 1
ifact[0] = ifact[1] = 1

for i in range(2, max_num):
    fact[i] = fact[i-1] * i % mod
    ifact[i] = ifact[i-1] * inv(i, mod) % mod


def cmb(x, y):
    return fact[x] * ifact[y] * ifact[x-y] % mod


def solve(r, c):
    ans = 0
    for i in range(r+1):
        ans += cmb(c+i+1, c)
        ans %= mod
    return ans


r1, c1, r2, c2 = map(int, input().split())

ans = solve(r2, c2) - solve(r2, c1-1) - solve(r1-1, c2) + solve(r1-1, c1-1)
ans %= mod

print(ans)


### FIXED CODE ###

mod = 10**9+7


def inv(a, mod):
    r = [1, 0, a]
    w = [0, 1, mod]
    while w[2] != 1:
        q = r[2]//w[2]
        r_new = [r[0]-q*w[0], r[1]-q*w[1], r[2]-q*w[2]]
        r = w
        w = r_new
    x, y = w[0], w[1]    # a*x+y*mod = 1
    return (mod+x % mod) % mod


max_num = 2*10**6+100
fact = [0 for _ in range(max_num)]
ifact = [0 for _ in range(max_num)]

fact[0] = fact[1] = 1
ifact[0] = ifact[1] = 1

for i in range(2, max_num):
    fact[i] = fact[i-1] * i % mod
    ifact[i] = ifact[i-1] * inv(i, mod) % mod


def cmb(x, y):
    return fact[x] * ifact[y] * ifact[x-y] % mod


def solve(r, c):
    ans = 0
    for i in range(r+1):
        ans += cmb(c+i+1, c)
        ans %= mod
    return ans


r1, c1, r2, c2 = map(int, input().split())

ans = solve(r2, c2) - solve(r2, c1-1) - solve(r1-1, c2) + solve(r1-1, c1-1)
ans %= mod

print(ans)
A,B,H,M=(int(x) for x in input().split())

import math

time = H*60 + M
dist = (5.5 * time)%360
if 0 < dist < 180:
   dist = 360 - dist

ans = math.sqrt(A*A + B*B  - 2*A*B*math.cos(math.radians(dist)))

print(ans)

### FIXED CODE ###

N = int(input())
a = int(N/10)
c = N-a*10

if c == 0 or c==1 or c==6 or c==8:
   print("pon")
elif c==3:
   print("bon")
else:
   print("hon")
h,a = tuple(map(int,input().rstrip().sprit()))
print((h+a-1)//a)

### FIXED CODE ###

h,a = tuple(map(int,input().rstrip().split()))
print((h+a-1)//a)
def resolve():
	n, k = map(int, input().split())
	a = list(map(int, input().split()))
	v = math.ceil((n - k) / (k-1) + 1)
	print(v)
resolve()

### FIXED CODE ###

import math
def resolve():
	n, k = map(int, input().split())
	a = list(map(int, input().split()))
	i = a.index(min(a)) + 1
	if k - 1 > i:
		v = max(0, math.ceil((n - k - 2) / (k - 1))) + 1
	else:
		v = math.ceil(i / (k - 1)) + math.ceil((n - i - 1) / (k - 1))
	print(v)
resolve()
# 最長共通部分　LCS ***未完成***
strA = input()
strB = input()
### 一致したら左上+1、そうでない場合は上か左のMAX
# / | 0 | A | B | C | B | A |
# 0 | 0 | 0 | 0 | 0 | 0 | 0 |
# B | 0 | 0 | 1 | 1 | 1 | 1 |
# B | 0 | 0 | 1 | 1 | 2 | 2 |
# A | 0 | 0 | 1 | 1 | 2 | 3 |
dp = [[0] * (len(strA) + 1) for _ in range(len(strB) + 1)]

for i, A in enumerate(strA, 1):
    for j, B in enumerate(strB, 1):
        if A == B:
            dp[j][i] = dp[j - 1][i - 1] + 1
        else:
            dp[j][i] = max(dp[j - 1][i], dp[j][i - 1])
ans = ""
cnt = 1
lstAns = dp[-1]
x, y = len(strB), len(strA)
while x > 0 and y > 0:
    if dp[x][y] == dp[x - 1][y]:
        x -= 1
    elif dp[x][y] == dp[x][y - 1]:
        y -= 1
    else:
        ans = strA[x] + ans
        x -= 1
        y -= 1
print(ans)

### FIXED CODE ###

# 最長共通部分　LCS ***未完成***
strA = input()
strB = input()
### 一致したら左上+1、そうでない場合は上か左のMAX
# / | 0 | A | B | C | B | A |
# 0 | 0 | 0 | 0 | 0 | 0 | 0 |
# B | 0 | 0 | 1 | 1 | 1 | 1 |
# B | 0 | 0 | 1 | 1 | 2 | 2 |
# A | 0 | 0 | 1 | 1 | 2 | 3 |
dp = [[0] * (len(strA) + 1) for _ in range(len(strB) + 1)]

for i, A in enumerate(strA, 1):
    for j, B in enumerate(strB, 1):
        if A == B:
            dp[j][i] = dp[j - 1][i - 1] + 1
        else:
            dp[j][i] = max(dp[j - 1][i], dp[j][i - 1])
ans = ""
cnt = 1
lstAns = dp[-1]
x, y = len(strA), len(strB)
while x > 0 and y > 0:
    if dp[y][x] == dp[y - 1][x]:
        y -= 1
    elif dp[y][x] == dp[y][x - 1]:
        x -= 1
    else:
        x -= 1
        y -= 1
        ans = strA[x] + ans

print(ans)
A = int(input())
B = int(input())
print('GREATER' if A > B else 'EQUAL' if A == B else 'LESS')

### FIXED CODE ###

s1,s2,s3 = input().split()
s = s1[0].upper() + s2[0].upper() + s3[0].upper()
print(s)
l = sort(map(int, input().split()))
if l[0] == l[1] == l[2]:
    print('1')
elif l[0] == l[1]:
    print('2')
else:
    print('3')


### FIXED CODE ###

l = sorted(map(int, input().split()))
if l[0] == l[1] == l[2]:
    print('1')
elif l[0] == l[1] or l[1] == l[2]:
    print('2')
else:
    print('3')
import numpy as np

n = int(input())
a_list = np.array(list(map(int, input().split())))
n_index = np.arange(1, n+1)

breaks = 0
if min(a_list) > 1:
    print(-1)
else:
    for n in n_index:
        if len(a_list) > 0:
            if n in a_list:
                i = a_list.index(n)
                a_list = a_list[i+1:]
                breaks += i
                print(a_list)
            else:
                breaks += len(a_list)
                print(breaks)
                exit()
    print(breaks)

### FIXED CODE ###

a=int(input())
b=int(input())
ans_list = [1,2,3]
print([i for i in ans_list if (i!=a and i!=b)][0])
def subtract_lst (lst1, lst2, ans):
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    a = ""
    b = ""
    for i in range(len(s) // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    print (min(subtract_lst (a, s, 0), subtract_lst (b, s, 0)))


### FIXED CODE ###

def subtract_lst (lst1, lst2):
    ans = 0
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    lenS = len(s)
    a = ""
    b = ""
    for i in range(lenS // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    aAns = subtract_lst (a, s)
    bAns = subtract_lst (b, s)
    print (min(aAns, bAns))
n=int(input())
s=input()
c=0
for i in range(1,N):
  x=set(s[:i])
  y=set(s[i:])
  a=x&y
  an=len(a)
  if an>c:
    c=an
print(c)


### FIXED CODE ###

n=int(input())
s=input()
c=0
for i in range(1,n):
  x=set(s[:i])
  y=set(s[i:])
  a = len(x & y)
  if a > c:
    c = a
print(c)
# 初期入力
N,A,B = (int(x) for x in input().split(" "))

# 赤と青を並べる
retu = ""
for j in range(10100):
    for i in range(A):
        retu += "b"
    for i in range(B):
        retu += "r"

b_num = retu[:N].count("b")
print(b_num)

### FIXED CODE ###

# 初期入力
S = input()

# 3つとも同じ会社だったらバスはない
s_list =[i for i in S]
if s_list[0] == s_list[1] and s_list[1] ==s_list[2]:
    print("No")
else:
    print("Yes")
N, M = map(int, input().split())

dp = [float("inf")] * (2 ** N)

dp[0] = 0

for i in range(M):
    
    a, b = map(int, input().split())
    c = list(map(int, input().split()))

    key = 0

    for j in c:
        key += 2 ** (j-1)

    for j in range(2**N):
        if dp[j | num] > dp[j] + a:
            dp[j | num] = dp[j] + a

if dp[2 ** N - 1] == float("inf"):
    print(-1)
else:
    print(dp[2 ** N - 1])

### FIXED CODE ###

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

dp = [float("inf")] * (2 ** N)

dp[0] = 0

for i in range(M):

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

    key = 0

    for j in c:
        key += 2 ** (j-1)

    for j in range(2**N):
        if dp[j | key] > dp[j] + a:
            dp[j | key] = dp[j] + a

if dp[2 ** N - 1] == float("inf"):
    print(-1)
else:
    print(dp[2 ** N - 1])