Sir my one test case is failed saying no output
/******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press “Run” button to execute it.
******************************************************************************/
import java.util.;
public class Main
{
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int N=s.nextInt();
Stack<Integer> st=new Stack<>();
int arr[]=new int[N];
if(arr.length==1){
System.out.println("-1");
}
for(int i=0;i<N;i++){
arr[i]=s.nextInt();
}
for(int j=1;j<arr.length;j++){
st.push(arr[0]);
while(!st.empty() && st.peek()<arr[j]){
System.out.print(arr[j]+" ");
st.pop();
}
}
if(st.empty()){
System.out.print("-1");
}
}
}