1902: CF742 - A. Arpa’s hard exam and Mehrdad’s naive cheat
[Creator : ]
Description
There exists an island called Arpa’s land, some beautiful girls live there, as ugly ones do.
Mehrdad has become quite confused and wants you to help him. Please help, although it's a naive cheat.
Input
The single line of input contains one integer $n\ (0≤n≤10^9)$.
Output
Print single integer− the last digit of $1378^n$.
Sample 1 Input
1
Sample 1 Output
8
last digit of $1378^1 = 1378$ is 8.
Sample 2 Input
2
Sample 2 Output
4
last digit of $1378^2 = 1378·1378 = 1898884$ is 4.