Task: Program Execution
Input (English): n, m, 6307, 8189, 5743, 8481, C, I, 505, 4007, Q, f, 4821, K, F, 7245, G, 5971, 9161
Output (English): 3, 4, 5, 6, 9, 10, 13, 16, 18, 19