import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Scanner; class Main { public static void main(String[] args) throws Exception { new Main().run(); } int NMAX=(int)3e6; int[] d=new int[NMAX]; { for(int div=1;div