AtCoder Regular Contest 113
B
A^B^C
AtCoder
⌀ 573
原题
← AC →
翻译中…

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}$.

翻译中…

样例

Input #1
4 3 2
Output #1
4
The ones digit in the decimal notation of $4^{3^2}=4^9=262144$ is $4$.
Input #2
1 2 3
Output #2
1
Input #3
3141592 6535897 9323846
Output #3
2
题目信息
题号
arc113_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。