Task: Program Execution
Input (English): i, m, 8753, 3835, Q, J
Output (English): i, m, Q, J