import java.util.ArrayList; import java.util.Scanner; public class Kaitenzushi { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt(); ArrayList V = new ArrayList<>(); for(int i = 0;i < N;i++){ V.add(s.nextInt()); } int MAX = 0; s.close(); if(N == 1){ MAX = V.get(0); }else { int D2 = V.get(1),D1 = V.get(0); if(N == 2){ MAX = Integer.max(D1, D2); }else{ for(int i = 2;i