Failing test cases

https://ide.codingblocks.com/s/350190. This is my code to print subsequences. Am I failing test cases because of order of output? Please let me know how to correct it

for string “bac”
Expected :-
a
ac
b
ba
bac
bc
c

Your output: -

c
a
ac
b
bc
ba
bac

correct this