import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scanner = new Scanner(System.in); int N = 0; if(scanner.hasNext()){ if(scanner.hasNextInt()){ N = scanner.nextInt(); } else{ System.out.println("Error"); System.exit(0); } } int[] h = new int[N]; for(int i=0;i