You are given a very simple problem: "What is the first digit of the number n^n?"
The input consists of several test cases. Each test case is given on a separate line and contains a single integer (1 \le n \le 10^9).
For each test case, print on a separate line the first digit of the result.
Example 1