Task: Program Execution
Input (English): 5, 5, ['S', 'x', '7817', 'G', 'X', 'w', 'w', 'f', 'g']
Output (English): X