Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10**7)

N, M = map(int, input().split())
link = [[] for _ in range(N)]
for _ in range(M):
    a, b, c = map(int, input().split())
    link[a-1].append([b-1, c])
visited = [0] * N
ans = 0

#全ての頂点からループしてないか確かめるといけないかな？
def dfs(v, cnt):
    global ans
    if v == N-1:
        if visited[v] == 0:
            ans = cnt
        else:
            ans = max(ans, cnt)
        for p in link[v]:
            if visited[p[0]] and ans > 0:
                ans = 'inf'
                print(ans)
                exit()
            elif visited[p[0]] and ans <= 0:
                break
    visited[v] = 1
    for nv in link[v]:
        dfs(nv[0], cnt+nv[1])
    return

dfs(0, 0)
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
a = [0] * M
b = [0] * M
c = [0] * M
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    c[i] = -c[i]
    
INF = 10 ** 13
dist = [INF] * N

dist[0] = 0

for loop in range(N-1):
    for i in range(M):
        if dist[a[i]-1] == INF:
            continue
        if dist[b[i]-1] > dist[a[i]-1] + c[i]:
            dist[b[i]-1] = dist[a[i]-1] + c[i]

ans = dist[N-1]

nega = [0] * N

for loop in range(N):
    for i in range(M):
        if dist[a[i]-1] == INF:
            continue
        if dist[b[i]-1] > dist[a[i]-1] + c[i]:
            dist[b[i]-1] = dist[a[i]-1] + c[i]
            nega[b[i]-1] = 1
        if nega[a[i]-1] == 1:
            nega[b[i]-1] = 1

if nega[N-1]:
    print('inf')
else:
    print(-ans)
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

flg = True
for i in range(len(s)):
    if ord(s[i]) > ord(t[i]):
        flg = False
        break
    if ord(s[i]) < ord(t[i]):
        break
        
print('Yes') if flg else print('No')
        

### FIXED CODE ###

s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

flg = False
for i in range(len(s)):
    if i >= len(t):
        break
    if ord(s[i]) > ord(t[i]):
        break
    if ord(s[i]) < ord(t[i]):
        flg = True
        break
    if i == len(s)-1 and i < len(t)-1:
        flg = True
        break
        
print('Yes') if flg else print('No')
n = int(input())
for i in range(1,3501):
  for j in range(i,3501):
    t = N*i*j % (4*n*w - N*w - n*N)
    if t==0:
      print(t,i,j)
      exit()


### FIXED CODE ###

N = int(input())
for n in range(1, 3501):
    for w in range(n, 3501):

        try:
            t = (N*n*w) % (4*n*w - N*w - N*n)
        except:
            continue

        if t == 0 and 4*n*w - N*w - N*n>=0:
            print((N*n*w) // (4*n*w - N*w - N*n), n, w)
            exit()
import math
x = int(input())
if x % 2 == 0:
  n += 1
else:
  n += 2
while True:
  isPrime = True
  for i in range(2, int(math.sqrt(n))):
    if n % i == 0:
      isPrime = False
      break
  if isPrime:
    print(n)
    break
  n += 2

### FIXED CODE ###

import math
x = int(input())
n = x
while True:
  isPrime = True
  for i in range(2, int(math.sqrt(n))):
    if n % i == 0:
      isPrime = False
      break
  if isPrime:
    print(n)
    break
  n += 1
s=input()
n=len(s)
x=(n-1)//2
while i<x:
  if s[i]!=s[n-1-i] or s[i]!=s[x-1-i]:
    print('No')
    break 
  i=i+1
else:
  print('Yes')

### FIXED CODE ###

s=input()
n=len(s)
x=(n-1)//2
v=0
for i in range(x):
  if s[i]==s[n-1-i]==s[x-1-i]:
    v=v+1
if v==x:
  print('Yes')
else:
  print('No')
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left, bisect_right
from copy import copy
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():

    N = I()
    XY = LLIN(N)
    XY.sort()
    if N == 1:
        print(1)
        exit()
    
    count = defaultdict(int)
    for i, (x1, y1) in enumerate(XY):
        for j, (x2, y2) in enumerate(XY[i+1:]):
            dx, dy = x1 - x2, y1 - y2
            count[(dx, dy)] += 1
    print(N - max(count.values()))
    
    
                        
if __name__ == '__main__':
    main()

### FIXED CODE ###

#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N, K = MI()
    if K == 1:
        print(0)
    else:
        print(N-K)
if __name__ == '__main__':
    main()
import math
N=int(input())
ans=len(str(N))
for a in range(2,math.sqrt(N)+1):
    if N%a==0:
        b=N//a
        ans=min(ans,len(str(b)))
print(ans)

### FIXED CODE ###

N=int(input())
ans=len(str(N))
for a in range(2,int(N**0.5)+1):
    if N%a==0:
        b=N//a
        ans=min(ans,len(str(b)))
print(ans)
N=int(input())
ans=0
c=[[0 for _ in range(10)] for _ in range(10)]

for n in range(1,N+1):
    i=n%10
    j=n
    while 10<=k:
        j=j//10
    c[i][j]=c[i][j]+1

for i in range(10):
    for j in range(10):
        ans=ans+c[i][j]*c[j][i]
print(ans)

### FIXED CODE ###

N=int(input())
ans=0
c=[[0 for _ in range(10)] for _ in range(10)]

for n in range(1,N+1):
    i=n%10
    j=n
    while 10<=j:
        j=j//10
    c[i][j]=c[i][j]+1

for i in range(10):
    for j in range(10):
        ans=ans+c[i][j]*c[j][i]
print(ans)
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mx = 0
for i in range(min(n + 1, k + 1)):
	for j in range(min(k - i + 1, n - i + 1)):
		summa = 0
		b = []
		for t in range(i):
			b.append(a[t])
		for t in range(n - j, n):
			b.append(a[t])
		z = k - i - j
		b.sort()
		for x in b:
			if x < 0 and z > 0:
				z -= 1
			else:
				summa += x
		mx = max(mx, summa)
print(mx)


### FIXED CODE ###

a, b = map(int, input().split())
a = a * 3 + b
print(a // 2)
import sys, os, math, bisect, itertools, collections, heapq, queue
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    H, N = il()
    magic = [il() for _ in range(N)]
    dp = [0] * (H + 1)

    dp[0] = 0
    for h in range(1, H + 1):
        for n in range(N):
            if n == 0:
                if magic[n][0] <= h:
                    dp[h] = dp[h - magic[n][0]] + magic[n][1]
                else:
                    dp[h] = magic[n][1]
            else:
                if magic[n][0] <= h:
                    dp[h] = min(dp[h], dp[h - magic[n][0]] + magic[n][1])
                else:
                    dp[h] = min(dp[h], magic[n][1])
    print(dp[-1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    H, N = il()
    magic = [il() for _ in range(N)]
    dp = [0] * (H + 1)

    dp[0] = 0
    for h in range(1, H + 1):
        for n in range(N):
            if n == 0:
                if magic[n][0] <= h:
                    dp[h] = dp[h - magic[n][0]] + magic[n][1]
                else:
                    dp[h] = magic[n][1]
            else:
                if magic[n][0] <= h:
                    dp[h] = min(dp[h], dp[h - magic[n][0]] + magic[n][1])
                else:
                    dp[h] = min(dp[h], magic[n][1])
    print(dp[-1])


if __name__ == '__main__':
    main()
a, b = map(int, input().split())
if a < b:
  swap(a, b)

if a - b >= 2:
  print(2 * a - 1)
else:
  print(a + b)

### FIXED CODE ###

a, b = map(int, input().split())
if a < b:
  a, b = b, a

if a - b >= 2:
  print(2 * a - 1)
else:
  print(a + b)
a,b,c = map(int(),input().split())
sum = a+b+c

if 22 <= sum:
    print('bust')
else:
    print('win')


### FIXED CODE ###

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

if sum >= 22:
    print('bust')
else:
    print('win')
#coding: utf-8

def __input__():
    X = str(input("―― "))
    em = 0
    Return = []
    error = False
    for spam in range(len(X)):
        if X[spam] == " ":
            Return.append(int(X[em:spam]))
            em = spam+1
    Return.append(X[em:])

l = __input__()
x = 1
for a in l:
  x *= a

print(x)


### FIXED CODE ###

X = str(input())
em = 0
Return = []
for spam in range(len(X)):
    if X[spam] == " ":
        Return.append(int(X[em:spam]))
        em = spam+1
Return.append(int(X[em:]))
x = 1
for a in Return:
    x = x * a

print(x)
w=input()
s=[0]*123
while len(w)==0:
    for i in range(97,97+26):
        if chr(i)==w[0]:
        s[i]+=1
        w=w[1:]
c=1
for i in range(97,97+26):
    if s[i]%2==0:
        continue
    else:
        c=0
        break
if c=1:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

w=input()
s=[0]*123
for i in range(len(w)):
    s[ord(w[i-1])]+=1
c=1
for i in range(97,97+26):
    if s[i]%2==1:
        c=0
        break
if c==1:
    print("Yes")
else:
    print("No")
A,B=map(int,input().split())
if len(A)==1 and len(B)==1:
  print(A*B)
else:
  print("-1")

### FIXED CODE ###

A,B=map(str,input().split())
if len(A)==1 and len(B)==1:
    print(int(A)*int(B))
else:
    print("-1")
N = list(map(int, input().split()))
d = {}

pos=[]
for x in range(N[0]):
    a = list(map(int, input().split()))
    for y in pos:
        key = (a[0]-y[0])*(10**11)+(a[1]-y[1])
        if key<0:
            key=-key
    pos.append(a)
    
print(N[0]-max(d.values()))

### FIXED CODE ###

N = list(map(int, input().split()))
d = {0:0}

pos=[]
for x in range(N[0]):
    a = list(map(int, input().split()))
    for y in pos:
        key = (a[0]-y[0])*(10**11)+(a[1]-y[1])
        if key<0:
            key=-key
        if key not in d.keys():
            d[key] = 0
        d[key] += 1
    pos.append(a)
    
print(N[0]-max(d.values()))
nm = list(map(int, input().split()))
a = list(map(int, input().split()))
Sum=0
flag=0

for i in range(len(a)):
    Sum+=a[i]

a.sort(reverse=True)

for i in range(nm[1]):
    if a[i]<sum/(4*nm[1]):
        flag=1
        break

if flag==1:
    print(No)
else:
    print(Yes)


### FIXED CODE ###

nm = list(map(int, input().split()))
a = list(map(int, input().split()))
Sum=0
flag=0

for i in range(len(a)):
    Sum+=a[i]

a.sort(reverse=True)

for i in range(nm[1]):
    if a[i]<Sum/(4*nm[1]):
        flag=1
        break

if flag==1:
    print('No')
else:
    print('Yes')
import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
M = 1000000007
N = int(input())
left = list(map(int, input().split()))
assert len(left) == N
assert left[0] == 0

counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    #assert sum(h) == N
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())


### FIXED CODE ###

import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(sys.stdin.readline())
left = list(map(int, sys.stdin.read().split()))
counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    if sum(h) != N:
        return 0
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())
x = int(input())

p5 = []
for i in range(-100, 101):
    p5.append(i**5)

for ci in range(201):
    if p5[ci] - x in p5:
        a = [ci-100, p5.index(p5[ci] - x)-100]
        break
a = [str(i) for i in a]
print(' '.join(a))

### FIXED CODE ###

x = int(input())

p5 = []
m = 1000
for i in range(-m, m+1):
    p5.append(i**5)

for ci in range(2*m+1):
    if p5[ci] - x in p5:
        a = [ci-m, p5.index(p5[ci] - x)-m]
        break
a = [str(i) for i in a]
print(' '.join(a))
a,b=map(int,input().split())
print a
print b

### FIXED CODE ###

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

BDA = B/A

if isinstance(n, int) == True:
    print(A+B)
else:
    print(A-B)

### FIXED CODE ###

a,b = map(int,input().split())
 
if b % a == 0:
    print(a+b)
else:
    print(b-a)
import math
from functools import reduce
input()
def gcd(*numbers):
    return reduce(math.gcd, numbers)
print(gcd(*[int(i) for i in input().split()]))

### FIXED CODE ###

# import math
from functools import reduce
input()
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def gcds(*numbers):
    return reduce(gcd, numbers)
print(gcds(*[int(i) for i in input().split()]))
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    X = int(input())
    for B in range(1001):
        A5 = X + B ** 5
        A = int(A5 ** 0.2)
        if A ** 5 == A5:
            print(A, B)
            return 

        A5 = X - B ** 5
        A = int(A5 ** 0.2)
        if A ** 5 == A5:
            print(A, -B)
            return 


if __name__ == "__main__":
    main()


### FIXED CODE ###

import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    X = int(input())
    for B in range(1001):
        A5 = X + B ** 5
        A = int(A5 ** 0.2) if A5 > 0 else int((-A5) ** 0.2) * -1
        if A ** 5 == A5:
            print(A, B)
            return 

        A5 = X - B ** 5
        A = int(A5 ** 0.2) if A5 > 0 else int((-A5) ** 0.2) * -1
        if A ** 5 == A5:
            print(A, -B)
            return 

    print(-1)

if __name__ == "__main__":
    main()
import numpy

N,M,K = map(int, input().split())
ans = 0
A = list(map(int,input().split()))
B = list(map(int,input().split()))

A = numpy.cumsum(numpy.array(A))
A = list(A)
A.insert(0, 0)
B = numpy.cumsum(numpy.array(B))
B = list(B)
B.insert(0, 0)
ans = 0

for i in range(N+1):
    if A[i] > K:
        break
    for j in range(M+1):
        if A[i] + B[j] <= K:
            ans = max(i+j,ans)
        else :
            break

print(ans)

### FIXED CODE ###

import numpy
import bisect

N,M,K = map(int, input().split())
ans = 0
A = list(map(int,input().split()))
B = list(map(int,input().split()))

A = numpy.cumsum(numpy.array(A))
A = list(A)
A.insert(0, 0)
B = numpy.cumsum(numpy.array(B))
B = list(B)
B.insert(0, 0)
ans = 0

for i in range(N+1):
    if K - A[i] < 0:
        break
    b = bisect.bisect(B, K - A[i])
    ans = max(ans, i+b-1)

print(ans)
n=int(input())
l=[]
sum=0
for i in range(1,n+1):
         if  i%3==0 and i%5 ==0:
                    l.apoend("FizzBuzz")
         elif i%3==0 and i%5!=0:
                    l.append("Fizz")
         elif i%5==0 and i%3!=0:
                    l.append("Buzz")
         elif i%3!=0 and i%5!=0:
                    l.append(i)
                    sum+=i
print(sum)
         
                   

### FIXED CODE ###

n=int(input())
l=[]
sum=0
for i in range(1,n+1):
         if i%3!=0 and i%5!=0:
                    l.append(i)
                    sum+=i
print(sum)
from math import gcd


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


A, B = tuple(map(int, input().split(" ")))

print(len(set(prime_factorize(gcd(A, B)))) + 1)


### FIXED CODE ###

from fractions import gcd


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


A, B = tuple(map(int, input().split(" ")))

print(len(set(prime_factorize(gcd(A, B)))) + 1)
x =  int(input())
 
def primes(z, n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if (is_prime[i]) and (i>=z) ]

Prime = primes(x, 10**5)
ans = Prime[0]
print(ans)

### FIXED CODE ###

x =  int(input())
 
def primes(z, n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if (is_prime[i]) and (i>=z) ]

Prime = primes(x, (10**5)+4)
ans = Prime[0]
print(ans)
s = input()$
return int(s)//3$


### FIXED CODE ###

s = input()
print(int(s)//3)
import copy

N=int(input())

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

#print(A)

mama=dict()
papa=dict()
papa[0]=0
papa[1]=0
papa[2]=1
for i in range(3,int(N/2)):
    papa[i]=int(i*papa[i-1]/2)
for i in range(N):

    if(A[i] in mama):
        print(mama[A[i]])
        continue
    
    AA=copy.deepcopy(A)
    ai=A[i]
    del AA[i]
    #print(AA)
    Aset=set(AA)
    count=0
    
    for i in Aset:
        aa=AA.count(i)
        if(aa in papa):
            count+=papa[aa]
            continue
        #print(i,aa)
        aiu=int((aa*(aa-1))/2)
        count+=aiu
        papa[aa]=aiu
    print(count)
    mama[ai]=count


### FIXED CODE ###

from collections import Counter
N=int(input())
A=list(map(int,input().split()))

parent=dict()
An=set(A)
parecou=0
aaa=Counter(A)
for i in aaa.values():
    parecou+=int((i*(i-1)/2))
"""
for i in An:
    f=A.count(i)
    parent[i]=f
    parecou+=int((f*(f-1)/2))
"""


#print(parecou)
for i in range(N):
    anko=aaa[A[i]]
    print(parecou-int((anko*(anko-1)/2))+int(((anko-2)*(anko-1)/2)))
    #print(parecou-anko+1)
a,b=(int(x) for x in input().split())
if a > b:
  while i == b:
    print(count(a))
else:
  while i == a:
    print(count(b))

### FIXED CODE ###

a,b=(int(x) for x in input().split())
i = 0
if a > b:
  while i < a:
    print(str(b), end="")
    i += 1
else:
  while i < b:
    print(str(a), end="")
    i += 1