eolymp
bolt
Try our new interface for solving problems
Problems

The first digit of the power

The first digit of the power

You are invited to a very simple task: "What is the first digit of the number $n^n$"? \InputFile Consists of several test cases. Each test is located on a separate line and contains one number $n~(1 \le n \le 10^9)$. \OutputFile For each test case print in a separate line the first digit of desired result.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
4
Output example #1
2
2