#P3406. Last digit

    ID: 2407 Type: RemoteJudge 1000ms 64MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>Northeastern Europe 2001, Western Subregion

Last digit

Description

Determine the last nonzero digit in value of expression

.

Input

The input contains a single line with n and m separated by one or several spaces; n, m are natural numbers from 1 to 1000000, nm.

Output

The output contains a single line with the last nonzero digit.

4 2
6

Source

Northeastern Europe 2001, Western Subregion