Ackermann Function#1111

Ackermann Function

1 second
128 megabytes
Easy

As is known, the Ackermann function plays an important role in theoretical computer science. However, due to its rapid growth, the function can be difficult to compute.

The Ackermann function is defined recursively for non-negative integers and as follows:

prb1111

Given and , compute the value of .

Input

Each line contains two non-negative integers and , where 0 \leq m \leq 3. For all m < 3, does not exceed 10^6. If m = 3, then does not exceed .

Output

For each given pair of numbers, print the value of the Ackermann function on a separate line.

Examples

Example 1

Loading
Loading