Task: Program Execution
Input (English): n, A, 3405, m, 8623, G, 9407, 8427, 1969
Output (English): 14, 1, 3405, 13, 8623, 7, 9407, 8427, 1969