Task: Program Execution
Input (English): 3, 9, ['r', '7123', '8313', 'P', '3655', 'r', '2867', 'D', 'N', '2717', '1713', '1767', '5263', '4967', 'W', '285', '733', '5855', 'N', 'A', 'X', '3673', 'r', '2491', '105', 'm', '509']
Output (English): 8313, 1767, X