Task: Program Execution
Input (English): j, g, 4787, 281, J, N, 4395, T, 1039, P
Output (English): 4787, 281, 4395, 1039