Task: Program Execution
Input (English): g, 3809, p, Q, 5157, 6283, 4297, A, n, 2217, 6973, 1709, V
Output (English): 30445