cho.sh
NotesCho Mini
Loading...

Multiplication

Time limit

1s

Memory limit

128 MB

Problem

Given two three-digit natural numbers A and B, compute their product in the usual vertical-multiplication order.

First multiply A by the ones digit of B, then by the tens digit of B, then by the hundreds digit of B. Finally, compute the full product A × B.

Input

The first line contains the three-digit natural number A. The second line contains the three-digit natural number B.

Output

On the first line, print A multiplied by the ones digit of B. On the second line, print A multiplied by the tens digit of B. On the third line, print A multiplied by the hundreds digit of B. On the fourth line, print A × B.