Task: Program Execution
Input (English): G, 5701, 2471, 4675, G, 1367, 5549, B, g, P, n, 8571, S, 8179, B, T, W
Output (English): 7, 5701, 2471, 4675, 7, 1367, 5549, 2, 7, 16, 14, 8571, 19, 8179, 2, 20, 23