Task: Program Execution
Input (English): q, 1723, p, s, 8171, e, G, w, h, n, 7283, 8359, 3339, S, 2711, 3181, 8811, E, 8523, W
Output (English): 17, 1723, 16, 19, 8171, 5, 7, 23, 8, 14, 7283, 8359, 3339, 19, 2711, 3181, 8811, 5, 8523, 23