SP10050 POWTOW - Power Tower City
Description
You are living in a city build entirely of power towers such as 3^3^3 and 10^10^10^10. To enter a building you must type the last 9 digits of the number represented by the tower, written in decimal form, on a keypad next to the main entrance. You are not sharp enough at mental maths, but you can write a handy program to bring along in your pocket.
A power tower is defined as repeated exponentiation. We write this using [Knuth's up-arrow notation](http://en.wikipedia.org/wiki/Knuth's_up-arrow_notation) as: e↑↑a = e^e^...^e (a terms). Remember that ^ (exponentiation) is right assosiative. For example: 2↑↑4 = 2^2^2^2 = 2^(2^(2^2)) = 2^2^4 = 2^16 = 65536, and 3↑↑1 = 3. The value of a tower of heigh 0 is 1.
Input Format
N/A
Output Format
N/A