import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); int n = koko.nextInt(); int[] a = new int[n]; for(int i =0; i=tc){ level=a[i]; } }else{ if(count>=tc){ tc=count; level=a[i-1]; count=0; } } } if(tc==0){ level=a[n-1]; } System.out.println(level); } }