Wrong test case for dictionary

in the test case that is shown in the question,the output does not seem to be in dictionary order…the order should be
abc
acb
bac
bca
what is the login behind printing no.s in such a way?

This is the correct order.
as in dictionary(smaller(increasing order) ).
its obviously true that in dictionary we first search according to the first letter in the word then we go the 2nd letter so (abc will come acb) as b comes before c(comparison in the 2nd letter)
likewise other cases

I still do not get it. the sequence
abc
acb
bac
bca
is correct right? considering the test case that is given in the question,the sequence is not printed in dictionary order.in which order am i supposed to print the answer?

in the order that’s given in the test cases of the question. the question test cases are checked and are right

Okay,I got it.Thanks