Task: Program Execution
Input (English): 6739 t r 8717 759 a 6701 d b 3003 x x 4787 487 M q B D u m 5477 l 4725 O 6883 2917 509 9873 8023 M 2743 T W Z
Output (English): 6739, 20, 18, 8717, 759, 1, 6701, 4, 2, 3003, 24, 24, 4787, 487, 13, 17, 2, 4, 21, 13, 5477, 12, 4725, 15, 6883, 2917, 509, 9873, 8023, 13, 2743, 20, 23, 26