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 MAXp = 0,MAXn = 0; s.close(); if(N == 1){ MAXp = V.get(0); }else { int D1p = V.get(1),D2p = V.get(0); int D1n = D2p,D2n = 0; if(N == 2){ MAXp = Integer.max(D1p, D2p); }else{ for(int i = 2;i