1246: ykc`s easy exam

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:368 解决:134

题目描述

        One day, YKC his most love the teacher, the teacher heard today to put the film, called the hunt for the barbarians, the name is really strange, like action movies, did not think it was a comedy, oh, no matter, can see a movie is good, but the teacher is naughty we don't want to so easily see this movie, so he thought of a good math (well, the original foreigner is such a love, he felt a certain Mathematics) someone can answer, the problem is that, to give you a fixed number: 1378. And then give you a n, so you ask the last digit of 1378^n is how much.. It sounds very simple, but it won't come out ah, how could feel so much number counted out, but there is a very clever girl out, know the answer after YKC feel the whole body is hollowed out, the original is so simple。。。

输入

The single line of input contains one integer n (0  ≤ n ≤  10^9).

输出

Print single integer — the last digit

样例输入 复制

1

样例输出 复制

8

来源/分类