Task: Program Execution
Input (English): p, n, 4651, 5005, 7959, 8785, 4147, g, 6121, 5379, G, J
Output (English): p, n, g, G, J, 4651, 5005, 7959, 8785, 4147, 6121, 5379