201131: [AtCoder]ARC113 B - A^B^C

Memory Limit:1024 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $400$ points

Problem Statement

Given positive integers $A, B, C$, find the digit at the ones place in the decimal notation of $A^{B^C}$.

Constraints

  • $1\leq A,B,C \leq 10^9$
  • $A,B,C$ are integers.

Input

Input is given from Standard Input in the following format:

$A$ $B$ $C$

Output

Print the digit at the one's place in the decimal notation of $A^{B^C}$.


Sample Input 1

4 3 2

Sample Output 1

4

The ones digit in the decimal notation of $4^{3^2}=4^9=262144$ is $4$.


Sample Input 2

1 2 3

Sample Output 2

1

Sample Input 3

3141592 6535897 9323846

Sample Output 3

2

Input

题意翻译

### 题目描述 这里有 $3$ 个正整数。请求出 $ A^{B^C} $ 的个位。 ### 输入格式 按以下格式输入。 > $ A $ $ B $ $ C $ ### 输出格式 输出 $ A^{B^C} $ 个位上的数。 ### 样例输入 #1 ``` 4 3 2 ``` ### 样例输出 #1 ``` 4 ``` ## 样例 #2 ### 样例输入 #2 ``` 1 2 3 ``` ### 样例输出 #2 ``` 1 ``` ## 样例 #3 ### 样例输入 #3 ``` 3141592 6535897 9323846 ``` ### 样例输出 #3 ``` 2 ``` ### 提示 - $ 1\leq\ A,B,C\ \leq\ 10^9 $ - $ A,B,C $ 是整数。 ### 样例说明 1 $ 4^{3^2}=4^9=262144 $ 的个位是 $ 4 $ 。

加入题单

算法标签: