<reponame>njw1204/BOJ-AC<filename>problem/01000~09999/02588/2588.py3.py
A=int(input())
B=[*map(int,input())]
print(A*B[2],A*B[1],A*B[0],A*int(''.join(map(str,B))),sep='\n')
A=int(input())
B=[*map(int,input())]
print(A*B[2],A*B[1],A*B[0],A*int(''.join(map(str,B))),sep='\n')