import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { int n = scan.nextInt(); int list[] = new int[n]; int dp[] = new int[n]; for(int i=0; i list[1]) System.out.println(list[0]); else System.out.println(list[1]); } else { for(int i=2; i dp[i]) dp[i] = dp[j] + list[i]; } } int ans = 0; for(int i=0; i