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

s1 = str(a)
s2 = str(b)

step1 = a *  int(s2[2])
step2 = a *  int(s2[1])
step3 = a *  int(s2[0])
result = a * b

print(step1)
print(step2)
print(step3)
print(result)
