Task: Program Execution
Input (English): q, 8793, 6505, 3507, S, M, 5449, 7949, 9185, h, 979, 1795
Output (English): 8793, 6505, 3507, 5449, 7949, 9185, 979, 1795