Task: Program Execution
Input (English): 1187, l, 5001, 6451, 7373, 6639, Q, R
Output (English): 2, 7, 8