1 sub 2 3 sub 4 a in 1 b in 3 c in 3 a in 2 => 1 sub 3 b in 1 => 4 sub 1 a in 4 b in 4 print 1 print 2 print 3 print 4 /* Correct result: 1: a 2: a 3: b c a 4: b c a */