Task: Program Execution
Input (English): N, 5257, H, G, l, 6499, 6787, 9781, 4293, v, 4577, H, 8717, G
Output (English): 5257, 6499, 6787, 9781, 4293, 4577, 8717