실버3 문제
from itertools import product
n, m = map(int, input().split())
arr = list(range(1, n+1))
answer = list(product(arr, repeat = m))
for i in answer:
for j in i:
print(j, end=" ")
print()
from itertools import product
n, m = map(int, input().split())
arr = list(range(1, n+1))
answer = list(product(arr, repeat = m))
for i in answer:
print(*i)