bzoj#P1988. The Teacher's Side of Math

The Teacher's Side of Math

题目描述

求 aba^b 的个位数字(十进制表示下的最后一位)。

输入格式

一行两个整数 a,ba,b(0≤a≤1090\le a\le 10^9,0≤b≤1090\le b\le 10^9)。

输出格式

输出一个整数,表示 aba^b 的个位数字。

样例输入

2 10

样例输出

4