try to rethink the logic of flip()
you are printing only once when k reaches the length of the string passed in your case 3.
try printing in the else block after calling flip() & before calling recursive() again.