// Key Interpreter Class

public class Interpreter

{
    //global variables
    static int letterNum;
    "" => string currWord;
    "" => string noWord;
    0 => static int clear;
    int letterStg[10];
    static int l0;
    static int l1;
    static int l2;
    static int l3;
    static int l4;
    static int l5;
    static int l6;
    static int l7;
    static int l8;
    static int l9;
    
    
    
    fun string translate ( int x )
    {
        if (clear == 1)
        {
            0 => clear;
            "" => currWord;
            0 => l0;
            0 => l1;
            0 => l2;
            0 => l3;
            0 => l4;
            0 => l5;
            0 => l6;
            0 => l7;
            0 => l8;
            0 => l9;
        }
        
        x-64 => letterNum;
        
        
        
        if ((0 < letterNum) && (letterNum < 27)) 
        {
            l1 => l0;
            l2 => l1;
            l3 => l2;
            l4 => l3;
            l5 => l4;
            l6 => l5;
            l7 => l6;
            l8 => l7;
            l9 => l8;
            letterNum => l9;
            
            [l9,l8,l7,l6,l5,l4,l3,l2,l1,l0] @=> letterStg;
            
            if (letterNum == 1)
            {
                "A" => string z;
                z +=> currWord;
            }
            if (letterNum == 2)
            {
                "B" => string z;
                z +=> currWord;
            }
            if (letterNum == 3)
            {
                "C" => string z;
                z +=> currWord;
            }
            if (letterNum == 4)
            {
                "D" => string z;
                z +=> currWord;
            }
            if (letterNum == 5)
            {
                "E" => string z;
                z +=> currWord;
            }
            if (letterNum == 6)
            {
                "F" => string z;
                z +=> currWord;
            }
            if (letterNum == 7)
            {
                "G" => string z;
                z +=> currWord;
            }
            if (letterNum == 8)
            {
                "H" => string z;
                z +=> currWord;
            }
            if (letterNum == 9)
            {
                "I" => string z;
                z +=> currWord;
            }
            if (letterNum == 10)
            {
                "J" => string z;
                z +=> currWord;
            }
            if (letterNum == 11)
            {
                "K" => string z;
                z +=> currWord;
            }
            if (letterNum == 12)
            {
                "L" => string z;
                z +=> currWord;
            }
            if (letterNum == 13)
            {
                "M" => string z;
                z +=> currWord;
            }
            if (letterNum == 14)
            {
                "N" => string z;
                z +=> currWord;
            }
            if (letterNum == 15)
            {
                "O" => string z;
                z +=> currWord;
            }
            if (letterNum == 16)
            {
                "P" => string z;
                z +=> currWord;
            }
            if (letterNum == 17)
            {
                "Q" => string z;
                z +=> currWord;
            }
            if (letterNum == 18)
            {
                "R" => string z;
                z +=> currWord;
            }
            if (letterNum == 19)
            {
                "S" => string z;
                z +=> currWord;
            }
            if (letterNum == 20)
            {
                "T" => string z;
                z +=> currWord;
            }
            if (letterNum == 21)
            {
                "U" => string z;
                z +=> currWord;
            }
            if (letterNum == 22)
            {
                "V" => string z;
                z +=> currWord;
            }
            if (letterNum == 23)
            {
                "W" => string z;
                z +=> currWord;
            }
            if (letterNum == 24)
            {
                "X" => string z;
                z +=> currWord;
            }
            if (letterNum == 25)
            {
                "Y" => string z;
                z +=> currWord;
            }
            if (letterNum == 26)
            {
                "Z" => string z;
                z +=> currWord;
            }  
        }
        if ((x == 32)||(x == 10))
        {
            1 => clear;
            return currWord;
        }
        if ((x != 32)&&(x != 10))
        {
            return noWord;
        }
        
    }
}