Problem:


Score : 200 points

Problem Statement

Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?

Constraints

1 \leq a \leq 9

1 \leq b \leq 9

a and b are integers.

Input

Input is given from Standard Input in the following format:

a b

Output

Print the lexicographically smaller of the two strings. (If the two strings are equal, print one of them.)

Sample Input 1

4 3

Sample Output 1

3333

We have two strings 444 and 3333. Between them, 3333 is the lexicographically smaller.

Sample Input 2

7 7

Sample Output 2

7777777



Sample input:
4 3


Sample output:
3333

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
if a>b:
  print(str(b)*a)
else:
  print(str(a)*b)

Submission status: Accepted

Solution code:
import numpy as np

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

if a <= b:
  a_ = np.full(b, a)
  for i in range(len(a_)):
    ans +=a_[i]*10**i
else:
  b_ = np.full(a, b)
  for i in range(len(b_)):
    ans +=b_[i]*10**i

print(int(ans))

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))

a = l[0]
b = l[1]

c = str(a)*b
d = str(b)*a

if c < d :
    print(c)
else:
    print(d)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
#while True:
b, c = map(int, input().split())
#	if(b < 10 and c < 10):
#		break
# 文字列の入力
#s = input()
#連結
#aaa = str(b) + str(c)
#print(aaa)
aaa = ''
bbb = ''
for num in range(c):
	aaa += str(b)
	
for num in range(b):
	bbb += str(c)


#一桁取得
testa = aaa[0]
testb = bbb[0]

# 出力
if(testa < testb):
	print(aaa)
else:
	print(bbb)

Submission status: Accepted

Solution code:
A, B = input().split()
i = A*int(B)
u = B*int(A)
print(sorted([i,u])[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if (a<b):
    print (str(a)*b)
elif (b<a):
    print (str(b)*a)
else:
    print (str(a)*a)

Submission status: Accepted

Solution code:
ab = input().split()
ab.sort()
c=int(ab[1])-1
ans=ab[0]
for i in range(c):
    ans = ans + ab[0]
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

p = ""
q = ""

for i in range(b):
    p = p + str(a)

for i in range(a):
    q += str(b)

lst = [p, q]

lst = sorted(lst)

print(lst[0])

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
a1=str(a)*b
b1=str(b)*a
if a==b:
  print(a1)
elif a>b:
  print(b1)
else:
  print(a1)

Submission status: Accepted

Solution code:
a, b = input().split(" ")
if a < b:
  print(a*int(b))
else:
  print(b*int(a))

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
c, d = "",""

for i in range(b):
    c += str(a)

for i in range(a):
    d += str(b)

if(c>=d):
    print(d)
else:
    print(c)

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
b = str(min(a))
c = max(a)
print(b * c)

Submission status: Accepted

Solution code:
N,M=map(int,input().split())
s=''
if N>M:
    for i in range(N):
        
        s+=str(M)
    print(s)
else:
    for i in range(M):
        s+=str(N)
    print(s)

Submission status: Accepted

Solution code:
s = [int(x) for x in input().split()]

str_a = str(s[0])
str_b = str(s[1])

# aをb回繰り返した文字列生成
for i in range(s[1]-1):
    str_a = str_a + str(s[0])

# bをa回繰り返した文字列生成
for i in range(s[0]-1):
    str_b = str_b + str(s[1])

# 生成した文字列のソート
str_list = [str_a,str_b]
str_list_sort = sorted(str_list)


print(str_list_sort[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))

if a <=  b:
  str_all = str(a)
  for _ in range(b - 1):
    str_all = str_all + str(a)

else:
  str_all = str(b)
  for _ in range(a - 1):
    str_all = str_all + str(b)

print(str_all)

Submission status: Accepted

Solution code:
a, b = input().split(" ")
print(a * int(b) if a <= b else b * int(a))

Submission status: Accepted

Solution code:
a, b = input().split()

a = int(a)
b = int(b)

ans = ''

if a >= b:
    for _ in range(a):
        ans = ans + str(b)
if b > a:
    for _ in range(b):
        ans = ans + str(a)
print(str(ans))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=[str(a)]*b
y=[str(b)]*a
if(b>=a):
    print("".join(x))
else:
    print("".join(y))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

print(str(a) * b if a < b else str(b) * a)

Submission status: Accepted

Solution code:
def p_result(lenn, numm):
    result = ""
    for i in range(lenn):
        result += str(numm)
    print(result)


num = list(map(int, input().split()))
if 1 <= num[0] <= 9 and 1 <= num[1] <= 9:
    if num[0] >= num[1]:
        p_result(num[0], num[1])
    elif num[0] <= num[1]:
        p_result(num[1], num[0])
    else:
        p_result(num[0], num[1])

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

sa = str(a)
sb = str(b)

ta = a * sb
tb = b * sa

if a>b:
    print (ta)
elif a<b:
    print (tb)
else:
    print (ta)

Submission status: Accepted

Solution code:
def main():
  a, b = map(int, input().split())
  ans = 0
  if a == b:
    for i in range(a):
      ans += a * pow(10,i)
  elif a < b:
    for i in range(b):
      ans += a * pow(10,i)
  else:
    for i in range(a):
      ans += b * pow(10,i)
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

first = 0
for i in range(b):
	first += a*(10**i)
  
second = 0
for j in range(a):
	second += b*(10**j)
    
if str(first)>str(second):
	print(second)
else:
  	print(first)

Submission status: Accepted

Solution code:
N, M=map(int,input().split())
if N == M:
  for x in range(0, N):
    print(N, end="")
elif N > M:
  for x in range(0, N):
    print(M, end="")
else:
  for x in range(0, M):
    print(N, end="")

Submission status: Accepted

Solution code:
b, c = map(int, input().split())
if b >= c:
  print(str(c) * b)
else:
  print(str(b) * c)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(min(str(a) * b, str(b) * a))

Submission status: Accepted

Solution code:
a,b = list(map(int, input().split()))

ans = ""
if a>b:
    for i in range(a):
        ans = ans + str(b)
    print(ans)
else:
    for i in range(b):
        ans = ans + str(a)
    print(ans)

Submission status: Accepted

Solution code:
a,b = input().split()

A = a*int(b)
B = b*int(a)

print(str(max(int(A),int(B))))

Submission status: Accepted

Solution code:
a,b = map(int, input().split())

str_a = [a] * b
str_b = [b] * a

if str_a > str_b:
    print(''.join(map(str, str_b)))
else:
    print(''.join(map(str, str_a)))

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
tex=""
if a <= b:
    for i in range(b):
        tex+=str(a)
    print(tex)
else:
    for i in range(a):
        tex+=str(b)
    print(tex)

Submission status: Accepted

Solution code:
sss = input().split()
a, b = sss[0], sss[1]

aa, bb = "", ""

for i in range(int(b)):
    aa += a

for i in range(int(a)):
    bb += b

if len(aa) <= len(bb):
    length = len(aa)
    ans = aa
else:
    length = len(bb)
    ans = bb

flag = 0
for i in range(length):
    if int(aa[i]) < int(bb[i]):
        flag = 1
        break
    elif int(aa[i]) > int(bb[i]):
        flag = -1
        break

if flag == 1:
    print(aa)
elif flag == -1:
    print(bb)
else:
    print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))
output = 0
if a >= b:
  print(str(b) * a)
else:
  print(str(a) * b)

Submission status: Accepted

Solution code:
from sys import stdin
lines = stdin.readlines()
 
a, b = map(str, lines[0].split())

A = a * int(b)
B = b * int(a)

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

Submission status: Accepted

Solution code:
C, D = input().split()
a = C*int(D)
b = D*int(C)
print(sorted([a,b])[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a, b = sorted([a,b])
print(int(str(a)*b))

Submission status: Accepted

Solution code:
a,b =map(int,input().split())

str_a = (str(a)*b)
str_b = (str(b)*a)

result = str_a
n = len(str_a)
for i in range(0,n):
  if int(str_a[i]) > int(str_b[i]):
    result = str_b
    break
  elif int(str_a[i]) < int(str_b[i]):
    result = str_a
    break
print(result)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
if n>m:n,m=m,n
print(str(n)*m)

Submission status: Accepted

Solution code:
input_list = list(map(int, input().split()))
num_f = input_list[0]
num_s = input_list[1]
f_str = str(num_f) * num_s
s_str = str(num_s) * num_f
list_ans = [f_str, s_str]
print(sorted(list_ans)[0])

Submission status: Accepted

Solution code:
a, b = (int(ab) for ab in input().split())
a_str = str(a)*b
b_str = str(b)*a
if a_str <= b_str:
    print(a_str)
else:
    print(b_str)

Submission status: Accepted

Solution code:
#B
a, b = map(int, input().split())
A = str(a)*b
B = str(b)*a
l = list([A, B])
l.sort()
print(l[0])

Submission status: Accepted

Solution code:
N,M = input().split(" ")
if N > M:
  str = M
  print(str*int(N))
else:
  str = N
  print(str*int(M))

Submission status: Accepted

Solution code:
a, b = input().split()

if a <= b:
  print(a * int(b))
elif a > b:
  print(b * int(a))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = str(a)
d = str(b)
f = str(a)
g = str(b)
for i in range(b-1):
	c += f
for o in range(a-1):
	d += g
e =[c, d]
e.sort()
print(e[0])

Submission status: Accepted

Solution code:
a,b = map(str,input().split())
L = []
L.append(a*int(b))
L.append(b*int(a))
L.sort()
print(L[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))

numa = str(a) * b
numb = str(b) * a

if b > a:
    print(numa)
else:
    print(numb)

Submission status: Accepted

Solution code:
a,b= input().split()

a2 = a * int(b)
b2 = b * int(a)

if int(a2) >= int(b2):
  print(a2)
else:
  print(b2)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))

if a >= b:
  print(''.join([str(b)] * a))
else:
  print(''.join([str(a)] * b))

Submission status: Accepted

Solution code:
a, b = input().split()
s,t = "", ""
i, j = 0, 0
while(i<int(b)):
  s += a
  i += 1

while (j<int(a)):
  t += b
  j += 1

if (int(a)<int(b)):
  print(s)
elif(int(a) == int(b)):
  print(s)
else:
  print(t)

Submission status: Accepted

Solution code:
num=[int(e) for e in input().split()]
A=str(num[0])
B = str(num[1])

if num[0]>=num[1]:
  for i in range(num[0]-1):
    B+=str(num[1])
  print(B)
else:
  for i in range(num[1]-1):
      A+=str(num[0])
  print(A)

Submission status: Accepted

Solution code:
x = input().split()
n = x[0]
m = x[1]
print(min(n*int(m), m*int(n)))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

ans = ''

if a <= b:
  for i in range(b):
    ans += str(a)
else: 
  for i in range(a):
    ans += str(b)  
 
print(ans)

Submission status: Accepted

Solution code:
L, R = map(int,input().split())
l = str(L)
r = str(R)
last_l = ""
last_r = ""
for i in range(L):
    last_r += r 
for i in range(R):
    last_l += l     
if L > R:
    print(last_r)
else:
    print(last_l)

Submission status: Accepted

Solution code:
N, M = (int(i) for i in input().split(' '))

if N * str(M) <= M * str(N):
  print(N*str(M))
else:
  print(M*str(N))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if str(a) * b < str(b) * a:
    print(str(a) * b)
elif str(a) * b > str(b) * a:
    print(str(b) * a)
else:
    print(str(a) * b)

Submission status: Accepted

Solution code:
import math

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

if math.factorial(a)**b > math.factorial(b)**a:
	print(str(b)*a)
elif math.factorial(a)**b < math.factorial(b)**a:
	print(str(a)*b)
else:
  	print(str(b)*a)

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
A = str(a) * b
B = str(b) * a
print(A if int(A)>int(B) else B )

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if(x>y):
  print(x*str(y))
else:
  print(y*str(x))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a==b:
    n=str(a)
    for i in range(a-1):
        n+=str(a)
    print(n)
else:
    if a>b:
        n=str(b)
        for i in range(a-1):
            n+=str(b)
        print(n)
    else:
        n=str(a)
        for i in range(b-1):
            n+=str(a)
        print(n)

Submission status: Accepted

Solution code:
n,m=(int(i) for i in input().split())
print(str(max(n,m)*str(min(n,m))))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

list = []
x = ''
for i in range(b):
  A = str(a)
  x = x + A
list.append(x)
  
y = ''
for i in range(a):
  B = str(b)
  y = y + B
list.append(y)

list.sort()
print(list[0])

Submission status: Accepted

Solution code:
a, b = input().split()


str_ = ''

if int(a) > int(b):
    for _ in range(int(a)):
        str_ = str_ + b    

elif int(a) <= int(b):
    for _ in range(int(b)):
        str_ = str_ + a

print(str_)

Submission status: Accepted

Solution code:
a,b=[int(s) for s in input().split(" ")]

ans=None

if a>b:

    ans=str(b)*a   

else:

    ans=str(a)*b

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
result = ""

if a == b:
    for i in range(a):
        result += str(a)

    print(result)
elif a < b:
    for i in range(b):
        result += str(a)

    print(result)
elif a > b:
    for i in range(a):
        result += str(b)

    print(result)

Submission status: Accepted

Solution code:
ab = input().split(' ')
a = ''
if ord(ab[0]) > ord(ab[1]):
  for i in range(int(ab[0])):
    a += ab[1]
else:
  for i in range(int(ab[1])):
    a += ab[0]
    
print(str(a))

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
minab = min(a,b)
maxab = max(a,b)
answer = ''
for x in range(maxab):
    answer = answer + str(minab)

print(answer)

Submission status: Accepted

Solution code:
a,b = list(map(int, input().split()))

if a > b:
    ans = ''
    for target_list in range(a):
        ans = ans + str(b)

    print(ans)

if b > a:
    ans = ''
    for target_list in range(b):
        ans = ans + str(a)

    print(ans)
    

if b == a:
    ans = ''
    for target_list in range(b):
        ans = ans + str(a)

    print(ans)

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
A=0
if a<b :
  n=10**b//10
  for i in range(b):
    A=A+a*n
    n=n//10
if b<a :
  n=10**a//10
  for i in range(a):
    A=A+b*n
    n=n//10
if a==b :
  n=10**a//10
  for i in range(a):
    A=A+b*n
    n=n//10
print(A)

Submission status: Accepted

Solution code:
I = []
I = input().split()
a = int(I[0])
b = int(I[1])

if a > b:
  c = str(b)
  print(c * a)
else:
  c = str(a)
  print(c * b)

#print('a=', a, ', b=', b)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(" "))
num =""
if a < b:
	#print aaaaaaaa....
	for i in range(b):
		num += str(a)

else:
	#print bbbbbbbb....
	for i in range(a):
		num += str(b)
print(num)

Submission status: Accepted

Solution code:
a,b=input().split()
ab=a*int(b)
ba=b*int(a)
print(ab if ab<ba else ba)

Submission status: Accepted

Solution code:
# coding: utf-8
a,b = [int(x) for x in input().split(" ")]
if a<b:
    tmp = a
    a = b
    b = tmp
print(str(b) * a)

Submission status: Accepted

Solution code:
a,b=input().split()
num1=""
for i in range(int(b)):
    num1+=a
num2=""
for i in range(int(a)):
    num2+=b
print(min(num1,num2))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if a<b:
  A = str(a)
  print(A*b)
elif a>b:
  B = str(b)
  print(B*a)
else:
  print(str(a)*a)

Submission status: Accepted

Solution code:
a, b = input().split()
aa = ""
bb = ""
for i in range(0, int(b)):
    aa += a
for j in range(0, int(a)):
    bb += b

if (int(a)>int(b)):
    print(bb)
else:
    print(aa)

Submission status: Accepted

Solution code:
import sys

A,B = map(int, raw_input().split())

#print A,B

if A > B:
    for i in range(A):
        sys.stdout.write(str(B))
    sys.stdout.write("\n")
else:
    for i in range(B):
        sys.stdout.write(str(A))
    sys.stdout.write("\n")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())


if a <= b:
    c = a
    for i in range(b-1):
        c = str(c) + str(a)
else:
    c = b
    for i in range(a-1):
        c = str(c) + str(b)
print(c)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())

print(str(min(a,b)) * max(a,b))

Submission status: Accepted

Solution code:
a,b = list(map(int, input().split()))

p = str(a)
q = str(b)
ans = ""

if(a==b):
  for i in range(a):
    ans += p
elif(a>b):
  for i in range(a):
    ans += q
elif(a<b):
  for i in range(b):
    ans += p
print(ans)

Submission status: Accepted

Solution code:
a ,b = map(int,input().split())

s1 = str(a)*b
s2 = str(b)*a
print(sorted([s1,s2])[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

ans_a = 0
ans_b = 0
ans = []
for i in range(b):
    ans_a = ans_a + a*10**i

for i in range(a):
    ans_b = ans_b + b*10**i

ans_a = str(ans_a)
ans_b = str(ans_b)

ans = [ans_a,ans_b]
answer = sorted(ans)
c = answer[0]
print(answer[0])

Submission status: Accepted

Solution code:
a,b=input().split()
x,y=int(a),int(b)
c,d=x*b,y*a
l=[]
l.append(c)
l.append(d)
l.sort()
print(l[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

X = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

for i in range(b):
    X[i] = str(a)
for j in range(a):
    Y[j] = str(b)

for k in range(9):
    if int(X[k]) < int(Y[k]):
        ｎX = [e for e in X if e != 0]
        print(''.join(nX))
        break
    elif int(X[k]) > int(Y[k]):
        ｎY = [e for e in Y if e != 0]
        print(''.join(nY))
        break
    else:
        if k == 8:
            ｎX = [e for e in X if e != 0]
            print(''.join(nX))

Submission status: Accepted

Solution code:
a,b = input().split()
a_int = int(a)
b_int = int(b)
ab = a*b_int
ba = b*a_int
if ab >= ba:
    print(ba)
elif ab <= ba:
    print(ab)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    a, b = LI()
    ans = [str(a) * b, str(b) * a]
    ans.sort()
    print(ans[0])
    return


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

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())
N = 0
M = 0
A = []
B = []
for i in range(0,b):
    N += a * (10 ** i)
    A.append(a)
for j in range(0,a):
    M += b * (10 ** j)
    B.append(b)
if A[0] <= B[0]:
    print(N)
else:
    print(M)

Submission status: Accepted

Solution code:
from fractions import gcd
# from datetime import date, timedelta
# from heapq import *
import heapq
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


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


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(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]]

def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


def modinv(a, mod):
    return modpow(a, mod - 2, mod)


def cnk(a, b):
    MOD = 10**9+7
    ret = 1
    for i in range(b):
        ret *= (a-i)
        ret %= MOD
        ret = ret * modinv(i+1, MOD) % MOD
    return ret




def main():
    # n = int(input())
    # a = list(map(int, input().split()))
    
    # v = a[0]
    # for i in range(1, n):
    #     v = lcm(v, a[i])
    
    # ans = 0
    # v %= MOD
    # for i in range(n):
    #     ans += v * modinv(a[i], MOD) % MOD
    #     ans %= MOD
    # print(ans)
    # n = int(input())
    # d = defaultdict(int)
    # for i in range(1,n+1):
    #     if i < 10:
    #         d[(i, i)] += 1
    #     else:
    #         d[(int(str(i)[-1]), int(str(i)[0]))] += 1
    
    # ans = 0
    # for i in range(1, n):
    #     if i < 10:
    #         ans +=d[(i, i)]
    #     else:
    #         if int(str(i)[-1]) == int(str(i)[0]):
    #             ans += d[(int(str(i)[0]), int(str(i)[-1]))]
    #         else:
    #             ans += d[(int(str(i)[0]), int(str(i)[-1]))]
    # print(ans)

            

    # ans = 0
    # for i in range(1,n+1):
    #     # if set(str(i)) == 1:
    #     #     continue
    #     ss = str(i)[::-1]
    #     if int(ss) <= n and str(ss)[0] != "0":
    #         ans += 1
    #         print(i,str(i)[::-1])
    # print(ans)

    # for i in range(1, 10):
    #     t = 0
    #     s = ""
    #     for j in range(6):
    #         s += str(i)
    #         if int(s) > n:
    #             break
    #         t += 1
    #     if t == 1:
    #         continue
    #     k = 1
    #     for j in range(1, t + 1):
    #         k*=j
    #     ans += k
    #     # print(k)
    # print(ans)   
    # n, m = map(int, input().split())
    # if n == m:
    #     print("Yes")
    # else:
    #     print("No")
    a, b = map(int, input().split())
    aa = ""
    for i in range(b):
        aa += str(a)
    bb = ""
    for i in range(a):
        bb += str(b)
    if a > b:
        print(bb)
    else:
        print(aa)
    # if aa >= bb:
    #     print(bb)
    # else:
    #     print(aa)




    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution 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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
res = ''
a, b = map(str, input().split())
if a < b:
	for interval in range(int(b)):
		res += a
else:
	for interval in range(int(a)):
		res += b
print(res)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
if a==b:
    print(str(a)*b)
elif a<b:
    print(str(a)*b);
else:
    print(str(b)*a)

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())

if a > b:
    for _ in range(a):
        print(b, end="")

    print()

else:
    for _ in range(b):
        print(a, end="")

    print()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if a == b:
    for i in range(b):
        print(a, end="")
elif a > b:
    for j in range(a):
        print(b, end="")
else:
    for i in range(b):
        print(a, end="")

Submission status: Accepted

Solution code:
a, b = (int(i) for i in input().split())
str_a = str(a)*b
str_b = str(b)*a
list_a = [str_a, str_b]
lst = sorted(list_a)
print(lst[0])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
 
a, b = map(int, input().split())
 
sa = ""
sb = ""
for i in range(b):
    sa = sa + str(a)
for i in range(a):
    sb = sb + str(b)
if sa < sb:
    print(sa)
else:
    print(sb)

Submission status: Accepted

Solution code:
a, b = list(map(int,input().split()))
s = str(a)*b
t = str(b)*a
print(min(s,t))

Submission status: Accepted

Solution code:
import sys

result = input().split()

str1 = str(result[0])*int(result[1])
str2 = str(result[1])*int(result[0])

if str1 < str2:
    print(str1)
else:
    print(str2)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a>b:
   c=[]
   for i in range(a):
       c.append(str(b))
   d=''.join(c)
else:
    c = []
    for i in range(b):
        c.append(str(a))
    d = ''.join(c)
print(d)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())

new_a = str(a)
new_b = str(b)
ans_a = int(new_a * b)
ans_b = int(new_b * a)

if a >= b:
  print(ans_b)
else:
  print(ans_a)

Submission status: Accepted

Solution code:
a,b = map(str,input().split())

ans = ""
bns = ""

for i in range(int(b)):
    ans += a
for j in range(int(a)):
    bns += b

if int(ans) > int(bns):
    print(int(ans))
else:
    print(int(bns))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if a > b:
    a, b = b, a

print(str(a) * b)

Submission status: Accepted

Solution code:
inp1 = input().split()
a = int(inp1[0])
b = int(inp1[1])

if a > b:
  print(str(b)*a)
else:
  print(str(a)*b)

Submission status: Accepted

Solution code:
a, b = input().split()

i = 1
A = a
while i < int(b):
    A = A + a
    i = i + 1

i = 1
B = b
while i < int(a):
    B = B + b
    i = i + 1

#print(A)
#print(B)

if A < B:
    print(A)
else:
    print(B)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
A=str(a)*b
B=str(b)*a
for i in range(min(len(A),len(B))):
  if int(A[i])>int(B[i]):
    print(B)
    break
  elif int(A[i])<int(B[i]):
    print(A)
    break
  if i==min(len(A),len(B))-1:
    print(A)

Submission status: Accepted

Solution code:
a,b=map(int,input().split(" "))
A=""
B=""

for i in range(b):
    A = A + str(a)
for i in range(a):
    B = B + str(b)
L = [A,B]
l = sorted(L)
print(l[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

l = max(a, b)
s = str(min(a, b))
ans = ''
for i in range(l):
    ans += s
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if str(a)*b < str(b)*a:
    print(str(a)*b)
elif str(a)*b > str(b)*a:
    print(str(b)*a)
else:
    print(str(b)*a)

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split()))
para_a = str(B)
para_b = str(A)

for i in range(A-1):
    para_a = para_a + str(B)

for i in range(B-1):
    para_b = para_b + str(A)

if para_a < para_b:
    print(para_a)
else:
    print(para_b)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if(a<b):
    A=str(a)
    for i in range (0,b-1):
        A=A+str(a)
    print(A)
else:
    B=str(b)
    for i in range(0,a-1):
        B=B+str(b)
    print(B)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
c1=[]
c2=[]
for i in range(y):
    c1.append(x)
for i in range(x):
    c2.append(y) 
ans=[]       

for i in range(min(x,y)):
    if c1[i]<c2[i]:
        ans=c1
        break    
    elif c1[i]>c2[i]:
        ans=c2
        break

if ans==[]:
    if x<y:
        for i in range(len(c1)):
            print(c1[i],end="")    
    else:
          for i in range(len(c2)):
            print(c2[i],end="")  
else:
       for i in range(len(ans)):
            print(ans[i],end="")

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
small = min(a, b)
st_small = str(small)
large = max(a, b)
count = 0
list = []
while count < large:
  list += st_small
  count += 1
print(''.join(list))

Submission status: Accepted

Solution code:
a, b = input().split()
ab = a * int(b)
ba = b * int(a)
i = 0
while i < len(ab) and i < len(ba):
    if ab[i] == ba[i]:
        i += 1
        continue
    elif int(ab[i]) < int(ba[i]):
        print(ab)
        break
    else:
        print(ba)
        break
if i == len(ab):
    print(ab)
elif i == len(ba):
    print(ba)

Submission status: Accepted

Solution code:
input_  = input().split()
a = input_[0]
b = input_[1]

a_i = int(a)
b_i = int(b)
ab = a*b_i 
ba=b*a_i


if ab>=ba:
    print(ba)
else:
    print(ab)

Submission status: Accepted

Solution code:
a, b = input().split()

if a < b:
    print(a * int(b))
else:
    print(b * int(a))

Submission status: Accepted

Solution code:
s=input().split()
a=int(s[0])
b=int(s[1])
out=[]
for i in range(max(a,b)):
    print(min(a,b),end='')
print()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from functools import reduce
from operator import add

def solve(a: int, b: int):
    if a <= b:
        a_str = str(a)
        for _ in range(b - 1):
            a_str += str(a)
        print(a_str)
    else:
        b_str = str(b)
        for _ in range(a - 1):
            b_str += str(b)
        print(b_str)

    return

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    solve(a, b)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
i=list(map(int,input().split()))
if i[0]>i[1]:
  a=str(i[1])*i[0]
else:
  a=str(i[0])*i[1]
print(a)

Submission status: Accepted

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

if(A<B):
	print(A)
else:
	print(B)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    a, b = input().split()
    print(min(a * int(b), b * int(a)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

Aa = 0
i = 0
for i in range (b):
    A = (10**i)*a
    Aa = A + Aa
    i=i+1

Bb = 0
j = 0
for j in range (a):
    B = (10**j)*b
    Bb = B + Bb
    j=j+1
    
list = [Aa, Bb]
sorted = sorted(list)

print (sorted [1])

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
P = max(A,B)
Q = min(A,B)
for i in range(int(P)):
  print(str(Q), end="")

Submission status: Accepted

Solution code:
N,M = map(int,input().split())

if N>M:
    M = str(M)
    print("{}".format(M*N))
else:
    N = str(N)
    print("{}".format(N*M))

Submission status: Accepted

Solution code:
usr_input = input().split()
usr_input_1 = [usr_input[0]*int(usr_input[1]), usr_input[1]*int(usr_input[0])]
usr_input_1_sorted = sorted(usr_input_1, key = str)

print(usr_input_1_sorted[0])

Submission status: Accepted

Solution code:
input_ab = input().split(' ')
a = int(input_ab[0])
b = int(input_ab[1])

ab = ""
ba = ""

for i in range(b):
  ab = ab + input_ab[0]

for i in range(a):
  ba = ba + input_ab[1]

dic = [ab, ba]
sdic = sorted(dic)

print(sdic[0])