Harryxun/stf_run huggingface dataset:
S = list(input())
x, y = map(int, input().split())
c = 0
p = 0
q = 0
now = 0
R = []
L = []
for i in range(len(S)):
    if S[i] == "T":
        if p != 0:
            R.append(p)
            p = 0
        elif q != 0:
            L.append(q)
            q = 0
        c += 1
    elif c == 0:
        now += 1
    elif c % 2 == 0:
        p += 1
    else:
        q += 1
if p != 0:
    R.append(p)
if q != 0:
    L.append(q)

A = 2*(sum(R)+now)
B = 2*(sum(L))
dp_x = [[0]*(A+2) for _ in range(len(R)+2)]
dp_y = [[0]*(B+2) for _ in range(len(L)+1)]
c = 0
dp_x[0][sum(R)+now] = 1
dp_y[0][sum(L)] = 1
for i in range(1, len(R)+2):
    for j in range(A+2):
        if i == 1:
            if j - now >= 0:
                if dp_x[i-1][j-now] == 1:
                    dp_x[i][j] = 1
        else:
            if j - R[i-2] >= 0:
                if dp_x[i-1][j-R[i-2]] == 1:
                    dp_x[i][j] = 1
            if j + R[i-2] <= A+1:
                if dp_x[i-1][j+R[i-2]] == 1:
                    dp_x[i][j] = 1

for i in range(1, len(L)+1):
    for j in range(B+2):
        if j - L[i-1] >= 0:
            if dp_y[i-1][j-L[i-1]] == 1:
                dp_y[i][j] = 1
        if j + L[i-1] <= B+1:
            if dp_y[i-1][j+L[i-1]] == 1:
                dp_y[i][j] = 1

if dp_x[len(R)+1][x+sum(R)+now] == 1 and dp_y[len(L)][y+sum(L)] == 1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
S = list(input())
x, y = map(int, input().split())
c = 0
p = 0
q = 0
now = 0
R = []
L = []
for i in range(len(S)):
    if S[i] == "T":
        if p != 0:
            R.append(p)
            p = 0
        elif q != 0:
            L.append(q)
            q = 0
        c += 1
    elif c == 0:
        now += 1
    elif c % 2 == 0:
        p += 1
    else:
        q += 1
if p != 0:
    R.append(p)
if q != 0:
    L.append(q)

A = 2*(sum(R)+now)
B = 2*(sum(L))
dp_x = [[0]*(A+2) for _ in range(len(R)+2)]
dp_y = [[0]*(B+2) for _ in range(len(L)+1)]
c = 0
dp_x[0][sum(R)+now] = 1
dp_y[0][sum(L)] = 1
for i in range(1, len(R)+2):
    for j in range(A+2):
        if i == 1:
            if j - now >= 0:
                if dp_x[i-1][j-now] == 1:
                    dp_x[i][j] = 1
        else:
            if j - R[i-2] >= 0:
                if dp_x[i-1][j-R[i-2]] == 1:
                    dp_x[i][j] = 1
            if j + R[i-2] <= A+1:
                if dp_x[i-1][j+R[i-2]] == 1:
                    dp_x[i][j] = 1

for i in range(1, len(L)+1):
    for j in range(B+2):
        if j - L[i-1] >= 0:
            if dp_y[i-1][j-L[i-1]] == 1:
                dp_y[i][j] = 1
        if j + L[i-1] <= B+1:
            if dp_y[i-1][j+L[i-1]] == 1:
                dp_y[i][j] = 1

if A + 1 < x+sum(R)+now or x+sum(R)+now < 0:
    print("No")
    sys.exit()

if B + 1 < y+sum(L) or y+sum(L) < 0:
    print("No")
    sys.exit()

if dp_x[len(R)+1][x+sum(R)+now] == 1 and dp_y[len(L)][y+sum(L)] == 1:
    print("Yes")
else:
    print("No")
a, b = map(int, input().split())
 
if a > b:
  print(str(b) * a)
else
  print(str(a) * b)

### FIXED CODE ###

a_str, b_str = input().split()
a = int(a_str)
b = int(b_str)

A = a_str*b
B = b_str*a
 
print(min(A, B))
A, B = list(map(int, (input().split())))
k = -1
if A <= 9 && B <= 9:
  k = A * B
print(str(k))


### FIXED CODE ###

A, B = list(map(int, (input().split())))
k = -1
if (A <= 9 ) and ( B <= 9):
  k = A * B
print(str(k))
a=int(input())
b=a%10
if b==0,1,6,8:
  print("pon")
elif b==2,4,5,7,9:
  print("hon")
else:
  print("bon")

### FIXED CODE ###

a=int(input())
b=a%10
if b in [0,1,6,8]:
  print("pon")
elif b in [2,4,5,7,9]:
  print("hon")
else:
  print("bon")
n=int(input())
print(N**3)

### FIXED CODE ###


n=int(input())
print(n**3)
R=input()
r=2*3.14159265358979*R
print(r)

### FIXED CODE ###

R=int(input())
r=2*3.14159265358979*R
print(r)
N = int(input())
A = list(map(int, input().split()))
import numpy as np
a = np.array(A)
b = np.zeros((N,N))
for i in range(N):
    if i < (N-1):
        b[i][i] = 1
        b[i][i+1] = 1
    else:
        b[i][i] = 1
        b[i][0] = 1
c = np.linalg.inv(b)
x = np.dot(2,np.dot(c,a))
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
a = np.array(A)
# l = int(((N*N)+1)/2)
b = []
for i in range(N):
    if i%2==0:
        b.append(1)
    else:
        b.append(-1)
c = np.dot(np.array(b),a)
x = [c]
for j in range(1,N):
    x_j = 2*a[j-1] - x[j-1]
    x.append(x_j)
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))
r=input()
print(r**2)

### FIXED CODE ###

print(int(input())**2)
a, b, c, k = [int(x) for x in input().split()]

if k <= a:
  print(k)
elif k<= a+b:
  print(a)
else:
  print(a-(k-a-b))

### FIXED CODE ###

s= str(input())
t= str(input())

if len(t) == len(s) + 1 and len(s) >=1 and len(s) <= 10 and t.islower() and s.islower() and s==t[:-1]:
  print("Yes")
else:
  print("No")
s=list(input())
dna = ["A","T","G","C"]
res=[]
x=0
for i in range(len(s)):
    if s[i] in dna:
        x+=1
    else:
        res+=[x]
        x=0
print(max(res))

### FIXED CODE ###

s=list(input())
dna = ["A","T","G","C"]
res=[0]
x=0
for i in range(len(s)):
    if s[i] in dna:
        x+=1
    else:
        res+=[x]
        x=0
print(max(x,max(res)))
rom sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    x, n = map(int, input().split())
    p = list(map(int, input().split()))
    arr = []
    for i in range(-100, 201):
        if not i in p:
            arr.append(i)
    ans = arr[0]
    for ai in arr:
        if abs(ai - x) < abs(ans - x):
            ans = ai
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()


### FIXED CODE ###

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    x, n = map(int, input().split())
    p = list(map(int, input().split()))
    arr = []
    for i in range(-100, 201):
        if not i in p:
            arr.append(i)
    ans = arr[0]
    for ai in arr:
        if abs(ai - x) < abs(ans - x):
            ans = ai
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
l=s.sort()
for i in t:
	for j in l:
		if int(i)==int(j):
			c +=1
			break
print(c)


### FIXED CODE ###

c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))
N = int(input())
S = list(int(input()))
K = int(input())
s = S[K-1]

for i in range(N):
    if S[i] == s:
        pass
    else:
        S[i] = '*'

print(''.join(S))



### FIXED CODE ###

N = int(input())
S = list(input())
K = int(input())
s = S[K-1]

for i in range(N):
    if S[i] == s:
        pass
    else:
        S[i] = '*'

print(''.join(S))
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
from math import factorial
K, S = map(int, input().split())
S = S if K * 3 / 2 > S else K * 3 - S
count = int(factorial(S+2) / factorial(2) / factorial(S+2 - 2))
print(str(count))


### FIXED CODE ###

#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K and z >= 0:
            count += 1
print(str(count))
D,T,S = map(int,input.split())
if D/S <= T:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

D,T,S = map(int, input().split())
if D/S <= T:
  print("Yes")
else:
  print("No")
a=input()
print(a*a)

### FIXED CODE ###

a = int(input())
a = a*a
print(a)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
A,B = map(int, input().split())
if (A = 2) or (B = 2):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
A,B = map(int, input().split())
if (A == 2) or (B == 2):
  print("No")
else:
  print("Yes")
a=input() #len input
b=input() #string input
if len(b)>int(a): # if exceed the len given
    print(b[:int(a)],". . .")
else:
    print(c)

### FIXED CODE ###

# Take both input K & S, then compare the length of S with K and assign it to length
# If the length is <= K print all
# And if length is >K print some of the character

K = int(input())
S = input()

x = 0

length = len(S)

if length <= K:
    print(S)
else:
    while x < K:
        print(S[x], end=(""))
        x += 1
    print("...")
H,W=list(map(int,input().split()))
A=[]
for i in range(H):
    A.append(list(map(int,input().split())))

for i,aline in enumerate(A):
    for j in range(W-1):
        if aline[j]%2==1:
            aline[j+1]+=1
            print('{0} {1} {2} {3}'.format(i+1,j+1,i+1,j+2))
for i,aline in enumerate(A[:-1]):
    if aline[W-1]%2==1:
        A[i+1][W-1]+=1
        print('{0} {1} {2} {3}'.format(i+1,j+1,i+2,j+1))

### FIXED CODE ###

H,W=list(map(int,input().split()))
A=[]
for i in range(H):
    A.append(list(map(int,input().split())))
sum_=0
ans=[]
for i,aline in enumerate(A):
    for j in range(W-1):
        if aline[j]%2==1:
            aline[j+1]+=1
            sum_+=1
            ans.append('{0} {1} {2} {3}'.format(i+1,j+1,i+1,j+2))
for i,aline in enumerate(A[:-1]):
    if aline[W-1]%2==1:
        A[i+1][W-1]+=1
        sum_+=1
        ans.append(('{0} {1} {2} {3}'.format(i+1,W,i+2,W)))
print(sum_)
for x in ans:
    print(x)
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N=int(input())
T=[]
for i in range(N):
    Ti=int(input())
    T.append(Ti)
print(lcm_list(T))

### FIXED CODE ###

import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N=int(input())
T=[]
for i in range(N):
    Ti=int(input())
    T.append(Ti)
print(lcm_list(T))
sn,bn=map(int,input().split(" "))
fu=[int(sn*(sn-1)/2)]
gr_si=[n for n in range(sn+1)]
siL_gr=[[n] for n in range(sn+1)]
siL_br=[]
for _ in range(bn):
    siL_br.append(list(map(int, input().split(" "))))
siL_br=siL_br[::-1]

for bri in range(bn-1):
    si1,si2=siL_br[bri]
    gr1 = gr_si[si1]
    gr2 = gr_si[si2]
    if gr1==gr2:
        fu.append(fu[bri])
    else:
        lengr1 = len(siL_gr[gr1])
        lengr2 = len(siL_gr[gr2])
        if lengr1<lengr2:
            gr1,gr2=gr2,gr1
        fu.append(fu[bri]-lengr1*lengr2)
        for si in siL_gr[gr2]:
            gr_si[si]=gr1
        siL_gr[gr1]+=siL_gr[gr2]

print(*fu[::-1],sep="\n")


### FIXED CODE ###

a,b,c=map(int,input().split(" "))
if a*c<=b:
    print(c)
else:
    print(b//a)
# C - Sum of gcd of Tuples (Easy)
from math import gcd
K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += gcd(a,b,c)
print(ans)

### FIXED CODE ###

# C - Sum of gcd of Tuples (Easy)
from math import gcd
K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += gcd(gcd(a,b),c)
print(ans)
h,w = map(int, input().split())
if h == 0 and w == 0:
else:
    for i in range(h):
        print("#"*w)
    print()


### FIXED CODE ###

#
# 5a
#

def main():
    while True:
        H, W = map(int, input().split())
        if H == W == 0:
            break
        for i in range(H):
            print("#"*W)
        print()


if __name__ == '__main__':
    main()
mod=int(1e9+7)
n,k=map(int,input().split())
g=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1; b-=1
  g[a].append(b); g[b].append(a);
 
dp=[-1 for x in range(n)]
def f(v,p):
  if dp[v]!=-1:
    return dp[v]
  dp[v]=0

  s=0
  if p>=0:
    for i in g[p]:
      s += 1 if dp[v]!=-1 else 0
 
  dp[v]=max(k-s,0)
  for i in g[v]:
    if i!=p:
      dp[v]=(dp[v]*f(i,v))%mod
  return dp[v]
 
print(f(0,-1))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

mod=int(1e9+7)
n,k=map(int,input().split())
g=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1; b-=1
  g[a].append(b); g[b].append(a);
 
dp=[-1 for x in range(n)]
def f(v,p):
  if dp[v]!=-1:
    return dp[v]

  dp[v]=1
  j=1+int(v!=0)
  for i in g[v]:
    if i!=p:
      dp[v]=(dp[v]*f(i,v)*max(k-j,0))%mod
      j+=1
  return dp[v]
 
print(f(0,-1)*k%mod)
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = a[::-1]


temp=0
z=0
for i in range((n+1)//2):
    for j in range(i+1,n):
        temp=comb(a[i],a[j])
        if z<temp:
            z=temp
            x,y=a[i],a[j]

def comb(m, r):
    if m-r<r:
        k=m-r
    else:
        k=r
    x=1
    for i in range(m,m-k,-1):
        x*=i
    for j in range(1,k+1):
        x//=j
    return x
print(x, y)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
x,a = a[-1],a[:-1]
temp = []
for i in a:
    temp.append(abs(x/2-i))
y=a[temp.index(min(temp))]
print(x,y)
h,w=map(int,input().split())
if (h*w)%2==1:
    print((h*w+1)//2)
else:
    print((h*w)//a2)

### FIXED CODE ###

h,w=map(int,input().split())
if (h-1)*(w-1)==0:
  print(1)
else:
  print(-(-h*w//2))
h, w = map(int, input().split())
mat = []
for i in range(h):
  mat.append(list(map(int, input().split())))

for y in range(h):
  if y % 2 == 0:
    for x in range(w-1):
      if mat[y][x] % 2 == 1:
        mat[y][x] -= 1
        mat[y][x+1] += 1
        print(y+1, x+1, y+1, x+1+1)
    x += 1
    if mat[y][x] % 2 == 1 and y < h-1:
        mat[y][x] -= 1
        mat[y+1][x] += 1
        print(y+1, x+1, y+1+1, x+1)
  if y % 2 == 1:
    for x in range(w-1, 0, -1):
      if mat[y][x] % 2 == 1:
        mat[y][x] -= 1
        mat[y][x-1] += 1
        print(y+1, x+1, y+1, x+1-1)
    x -= 1
    if mat[y][x] % 2 == 1 and y < h-1:
        mat[y][x] -= 1
        mat[y+1][x] += 1
        print(y+1, x+1, y+1+1, x+1)

count = 0        
for y in range(h):
  for x in range(w):
    if mat[y][x] % 2 == 0:
      count += 1
print(count)
        

### FIXED CODE ###

h, w = map(int, input().split())
mat = []
for i in range(h):
  mat.append(list(map(int, input().split())))
sousa = []
for y in range(h):
  if y % 2 == 0:
    x = -1
    for x in range(w-1):
      if mat[y][x] % 2 == 1:
        mat[y][x] -= 1
        mat[y][x+1] += 1
        sousa.append((y+1, x+1, y+1, x+1+1))
    x += 1
    if mat[y][x] % 2 == 1 and y < h-1:
        mat[y][x] -= 1
        mat[y+1][x] += 1
        sousa.append((y+1, x+1, y+1+1, x+1))
  if y % 2 == 1:
    x = w
    for x in range(w-1, 0, -1):
      if mat[y][x] % 2 == 1:
        mat[y][x] -= 1
        mat[y][x-1] += 1
        sousa.append((y+1, x+1, y+1, x+1-1))
    x -= 1
    if mat[y][x] % 2 == 1 and y < h-1:
        mat[y][x] -= 1
        mat[y+1][x] += 1
        sousa.append((y+1, x+1, y+1+1, x+1))

print(len(sousa))
for y,x,y1,x1 in sousa:
  print(y,x,y1,x1)
alp=[]
txt=[]
for i in range(97,97+26):
	alp.append(chr(i))	
while True:
	if input()=='':
		break
	else:
		a=input()
		for i in a:
			txt.append(str.lower(i))

for i in alp:
	num=0
	for j in txt:
		if i==j:
			num+=1
	print(i+' : '+str(num))



### FIXED CODE ###

import sys

alp=[]
for i in range(97,97+26):
	alp.append(chr(i))

s=sys.stdin.read().lower()

for i in alp:
	num=0
	for j in s:
		if i==j:
			num+=1
	print(i+' : '+str(num))
n=int(input())
s=input()
p=list(s.split())
s1=0
s2=0
for i in range(0,n)
  s1=s1+int(p[i])
  s2=s2+(int(p[i])*int(p[i]))
k= ((s1**2)-s2)//2
k=k%1000000007

print(k)


### FIXED CODE ###

n=int(input())
s=input()
p=list(s.split())
s1=0
s2=0
for i in range(0,n):
  s1=s1+int(p[i])
  s2=s2+(int(p[i])*int(p[i]))
k= ((s1**2)-s2)//2
k=k%1000000007
print(k)
# from itertools import product

INF = 10**18

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

# i番目までのケーキの内、j個食べた時のpointの最大値
# (ただしpointの計算時には、8通りのmaskを乗算する)

def mul_mask(l, mask):
    p = []
    for i, m in enumerate(l):
        p.append(m*mask[i])
        # print(p)
    return p
    # return [a*b for a, b in zip(l, mask)]

dp_std = [[-INF for _ in range(M+1)] for _ in range(N+1)]
for i in range(N+1):
    dp_std[i][0] = 0
# print(dp_std)

max_p = -INF
# masks = product([-1, 1], repeat=3)
masks = []
for i in [1, -1]:
    for j in [1, -1]:
        for k in [1, -1]:
            masks.append([i, j, k])
# print(masks)
for mask in masks:
    dp = dp_std.copy()
    for i in range(1, N+1):
        score = sum(mul_mask(XYZ[i-1], mask))
        for j in range(1, M+1):
            # print(i, j, XYZ[i-1], mask)
            dp[i][j] = max(
                dp[i-1][j],
                dp[i-1][j-1] + score
            )
            # for dp_i in dp:
            #     print(dp_i)
    p = dp[N][M]
    max_p = max(max_p, p)
    # print(p)

print(max_p)

### FIXED CODE ###

# from itertools import product

INF = 10**18

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

# i番目までのケーキの内、j個食べた時のpointの最大値
# (ただしpointの計算時には、8通りのmaskを乗算する)

def mul_mask(l, mask):
    p = []
    for i, m in enumerate(l):
        p.append(m*mask[i])
        # print(p)
    return p
    # return [a*b for a, b in zip(l, mask)]

dp_std = [[-INF for _ in range(M+1)] for _ in range(N+1)]
for i in range(N+1):
    dp_std[i][0] = 0
# print(dp_std)

max_p = -INF
# masks = product([-1, 1], repeat=3)
masks = []
for i in [1, -1]:
    for j in [1, -1]:
        for k in [1, -1]:
            masks.append([i, j, k])
# print(masks)
for mask in masks:
    dp = dp_std[:]
    for i in range(1, N+1):
        score = sum(mul_mask(XYZ[i-1], mask))
        for j in range(1, M+1):
            # print(i, j, XYZ[i-1], mask)
            dp[i][j] = max(
                dp[i-1][j],
                dp[i-1][j-1] + score
            )
            # for dp_i in dp:
            #     print(dp_i)
    p = dp[N][M]
    max_p = max(max_p, p)
    # print(p)

print(max_p)
if len(S) % 2 == 0:
  whiteS = '01'*len(S)//2
  blackS = '10'*len(S)//2
else:
  whiteS = '01'*len(S)//2 + '0'
  blackS = '10'*len(S)//2 + '1'
  
S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*len(S)//2
else:
  sample = unit*len(S)//2+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)

### FIXED CODE ###

S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*(len(S)//2)
else:
  sample = unit*(len(S)//2)+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)
a,b=int(input().split())
if a!=3 and b!=3:
  print(3)
elif a!=2 and b!=2:
  print(2)
else:
  print(1)

### FIXED CODE ###

a=int(input())
b=int(input())
if a!=3 and b!=3:
  print(3)
elif a!=2 and b!=2:
  print(2)
else:
  print(1)
from decimal import Decimal
A,B = input().split()
b = Decimal(B)
print(int(A*b))


### FIXED CODE ###

from decimal import Decimal
A,B = input().split()
b = Decimal(B)
print(int(int(A)*b))
x,y,a,b,c = map(int,input().split())
p_a = list(map(int,input().split()))
p_b = list(map(int,input().split()))
p_c = list(map(int,input().split()))
p_a.sort(reverse=True)
p_b.sort(reverse=True)
p_c.sort(reverse=True)
p_c += [0]

ans = p_a[:x] + p_b[:y]
ans.sort(reverse=True)
i = -1
p_c_sum = 0
while True:
    if ans[i] > p_c[0]:
        break
    else:
        ans[i] = 0
        i -= 1
        p_c_sum += p_c[0]
        p_c.pop(0)
print(sum(ans) + p_c_sum )

### FIXED CODE ###

x,y,a,b,c = map(int,input().split())
p_a = list(map(int,input().split()))
p_b = list(map(int,input().split()))
p_c = list(map(int,input().split()))
p_a.sort(reverse=True)
p_b.sort(reverse=True)
#p_c.sort(reverse=True)

ans = p_a[:x] + p_b[:y] + p_c
ans.sort(reverse=True)
print(sum(ans[:x+y]))
i = list(map(int, input().split()))
if A > 10 or B > 10:
  print('-1')
else:
  print('A * B')

### FIXED CODE ###

a = list(map(int,input().split()))
if a[0] >= 10 or a[1] >= 10:
  print('-1')
else:
  print(a[0] * a[1])
s = input()
k = input()
t = '1'

for i in range(len(s)) :
   if s[i]=='1' :
      continue
   else :
      t = s[i]
      break

print(t)

### FIXED CODE ###

a,b = map(int, input().split() )
print((a-1)*(b-1))
a=input()
b=input()

print a*b
print 2*a+2*b

### FIXED CODE ###

a,b=map(int,raw_input().split())
print a*b,(a+b)*2
def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3
 
def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]
 
def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum(a[0]) * 13 + int(a[1]))
    cards.reverse()
    for i in cards:
        print(tosuit(i // 13) + " " + (i % 13))
 
if __name__ == "__main__":
    main()


### FIXED CODE ###

def tonum(suit):
    if suit == 'S': return 0
    if suit == 'H': return 1
    if suit == 'C': return 2
    if suit == 'D': return 3
    
def tosuit(num):
    suits = ['S', 'H', 'C', 'D']
    return suits[num]
    
def main():
    n = int(input())
    cards = [i for i in range(52)]
    for i in range(n):
        a = input().split()
        cards.remove(tonum(a[0]) * 13 + int(a[1]) - 1)
    cards.sort()
    for i in cards:
        print(tosuit(i // 13) + " " + str(i % 13 + 1))
    
if __name__ == "__main__":
    main()
S = input()

result = []
count = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
    else:
        result.append(count)
        count = 0

print(max(result))

### FIXED CODE ###

S = input()

result = [0]
count = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
    else:
        result.append(count)
        count = 0
result.append(count)
print(max(result))
import sympy
n = int(input())
ans, count = 0, 0

for j in range(1, n+1):
    a = n//j
    ans += a*(a+1)*j//2
print(ans)


### FIXED CODE ###

n = int(input())
ans = 0

for j in range(1, n+1):
    a = n//j
    ans += a*(a+1)*j//2
print(ans)
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]


from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

# a, bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

# a, bの最小公倍数
def lcm(a, b):
    return a * b / gcd(a,b)

# リストnumbers最小公倍数
def lcmlist(numbers):
    a = numbers[0]
    for i in range(1, len(numbers)):
        a = lcm(a, numbers[i])
    return int(a)

#### START
n = int(input())
t = [int(input()) for i in range(n)]

print(lcmlist(t))


### FIXED CODE ###

# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]


from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

# a, bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

# a, bの最小公倍数
def lcm(a, b):
    return int(a * b) // gcd(a,b)

# リストnumbers最小公倍数
def lcmlist(numbers):
    a = numbers[0]
    for i in range(1, len(numbers)):
        a = lcm(a, numbers[i])
    return int(a)

#### START
n = int(input())
t = [int(input()) for i in range(n)]

print(lcmlist(t))
n, a, b = map(int(input().split()))

print(min(n*a,b))

### FIXED CODE ###

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

print(min(n*a, b))