Task: Program Execution
Input (English): 6, 8, ['K', '5485', '8025', '4985', 's', 'P', '8169', '995', '6439', '5061', '4699', '4167', '1657', 'G', 'q', '3967', '4771', 'M']
Output (English): 9958169P