Last digit

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on PKU. Original ID: 3406
64-bit integer IO format: %lld      Java class name: Main

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.

Sample Input

4 2

Sample Output

6

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .