You are given two positive integers A and B. Your task is to find the last decimal digit of A^B.
Input
The input consists of two lines.
The first line contains the integer A (0 \le A \le 10^{10^5}).
The second line contains the integer B (0 \le B \le 10^{10^5}).
Output
Print a single integer — the last decimal digit of A^B.
Examples
| standard input | standard output |
|---|
| 3
2
| 9
|
| 2
4
| 6
|
| 12
3
| 8
|
Note
There will be no test 0^0.
For the first test case 3^{2} = 9, so we just output 9.
For the second test case 2^{4} = 16, so we output last decimal digit, which is 6.
For the last test case 12^{3} = 1728, so we output 8.