Find the greatest Element (Java)

What is wrong in my code?
Please help

For input

3
3 2 1

Output should be

-1 3 3

Because array is circular,debug for this