import java.util.*; import java.util.stream.*; import static java.lang.Math.*; public class Main{ public static void main(String... args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); boolean[] isPrime=new boolean[n+1]; Arrays.fill(isPrime,true); isPrime[0]=false; isPrime[1]=false; for(int i=2;i primes=new ArrayList<>(); for(int i=0;i set=new HashSet<>(); for(int j=0;j