Task: Program Execution
Input (English): 3, 3, ['4877', 'N', 'g', 'p', 'h', '8757', 'u', 'r', 'F', '3115', '533', 'X', '973', 'g', '785']
Output (English): g, 8757, F, X, 785