#P3406. Last digit
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, n ≥ m.
Output
The output contains a single line with the last nonzero digit.
4 2
6
Source
Northeastern Europe 2001, Western Subregion