#P3406. Last digit

    ID: 2416 远端评测题 1000ms 64MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>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