Task: Program Execution
Input (English): 6, 9, ['g', 's', '31', '7169', '5581', 'M', 'r', 'H', 'J', 'R', '4185', 'j', 'v', '2501', '7989', 'B', '3331']
Output (English): M, r, H, J