Task: Program Execution
Input (English): 6, 18, ['6587', '5383', '8357', '9737', '4135', '2167', '3505', '27', '5363', 'S', 'A', '9769', 'M', '743', '6171', '1961', '2889', 'J', '9561', '5117', 'A']
Output (English): J, 2889, 1961, 6171, 743, M, 9769, A, S, 5363, 27, 3505, 2167