Algo++ : Find the greater element

My code passes only 1 test case . please help me finding out where i am wrong . code link : https://ide.codingblocks.com/s/105638

Try this testcase :
Input :
5
1 1 1 1 1

Expected Output :
-1 -1 -1 -1 -1

Your Output :
-1 1 1 1 1