Task: Program Execution
Input (English): 5089, f, N, E, W, 2149, r, 3105, d
Output (English): f, N, E, W, r, d