Test case not passing

I have included the given constraints in the program but still 1 of the test cases is giving wrong answer. Where am I going wrong?

There was an error in printing the order. Doubt resolved