Task: Program Execution
Input (English): q, 9397, 4641, m, B, 4523, Z
Output (English): 18561