Task: Program Execution
Input (English): M, 5961, 5759, 3019, q, 2823
Output (English): M, q, 5961, 5759, 3019, 2823