3rd Test Case not passing

I have written a code but 3rd case is showing wrong I don’t know what needs to be changed. Will you please help : )

Here’s a testcase for you to try
Input :
5
30
40
35
45
42
Expected Output :
1 2 1 4 1 END
Your code gives a different output.debug for this