Im9223372036854775808's blog

By Im9223372036854775808, history, 5 months ago, In English

Description

Tetration is a binary operator, defined as ʸx=xˣ(y times)ˣ. In other words, tetration is repeated exponentiation. In arrow notation it is defined as x^^y. Your goal is to count x^^y.

  • Input file contains two numbers x (1<=x<=1234), y (0<=y<=2)
  • Output contains one number y — answer.

Input, output

Example 1

Input

2 2

Output

4

Example 2

Input

5 0

Output

1

Example 3

Input

6 2

Output

46656

Soucre: Tetration