Task: Program Execution
Input (English): Z 1505 9447 m 5057 G 45 a e 3989 6749 7917 9845 S 573 8967 3653 x P 8977 h k g 3273 Z q 8353 5859 8985
Output (English): 2, 3, 5, 7, 10, 11, 12, 13, 15, 16, 17, 20, 24, 27, 28, 29