給定 $x$ , $d$, $M$
計算 $x^{x^{x^{...}}} \% M$ (共 $d$ 個 $x$)
第一行有三個數 $x$ $d$ $M$
$1≤d≤10, M≤100$ $\forall n \in \mathbb{Z}$ $n ≥ 10 :gcd(x, n) = 1$ $M≥100, x=7$
$ans$
7 1 100
7
循環