<reponame>Akash671/coding<gh_stars>0
n=int(input())
import math
s=str(math.factorial(n))
ans=[]
for i in range(len(s)):
   ans.append(int(s[i]))
print(ans)

#T(n)=(n^2)

n=int(input())
import math
s=str(math.factorial(n))
ans=[]
for i in range(len(s)):
   ans.append(int(s[i]))
print(ans)

#T(n)=(n^2)
#T(n)=(n^2)