import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] sa = br.readLine().split(" "); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = Integer.parseInt(sa[i]); } br.close(); int[] cnt = new int[1000001]; for (int i = 0; i < n; i++) { List list = divList(a[i]); for (int e : list) { cnt[e]++; } } int[] ans = new int[n]; for (int i = 1000000; i > 0; i--) { if (cnt[i] > 0) { int x = n - cnt[i]; if (ans[x] == 0) { ans[x] = i; } } } for (int i = 1; i < n; i++) { ans[i] = Math.max(ans[i], ans[i - 1]); } PrintWriter pw = new PrintWriter(System.out); for (int i : ans) { pw.println(i); } pw.flush(); } static List divList(int n) { List list = new ArrayList<>(); int end = (int) Math.sqrt(n); for (int i = 1; i <= end; i++) { if (n % i == 0) { list.add(i); } } int i = end * end == n ? list.size() - 2 : list.size() - 1; for ( ; i >= 0; i--) { list.add(n / list.get(i)); } return list; } }