import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static ArrayList pro=new ArrayList<>(); static long longestSequence(long[] a) { long ret=0; ArrayList niz= new ArrayList<>(); for (int i=0;i=n) break; if (n%br==0) ret=br; } return ret==0?n:ret; } static boolean prost(long n) { for(long i=2; i<=Math.sqrt(n);i++) { if (n%i==0) return false; } return true; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; long max=0; for(int a_i = 0; a_i < n; a_i++){ a[a_i] = in.nextLong(); if (a[a_i]>max) max=a[a_i]; } for (long i=2;i