String Sort problem

Help to solve this problem.
Plz just tell me where I am wrong don’t tell me the code.

@ravig8233
Input :
5
back
apple
batman
act
zoo

Expected Output :
act
apple
back
batman
zoo

Your Output :
act
apple
batman
back
zoo