eolymp
Competitions

Five for week 20

The first digit of the power

Time limit 1 second
Memory limit 64 MiB

You are invited to a very simple task: "What is the first digit of the number n^n"?

Input data

Consists of several test cases. Each test is located on a separate line and contains one number n (1n10^9).

Output data

For each test case print in a separate line the first digit of desired result.

Examples

Input example #1
3
4
Output example #1
2
2