import java.util.Scanner;



public class pp
{
	public static void main(String args[])
	{
		//System.out.println("a");
		
		Scanner sc = new Scanner(System.in);
		StringBuffer vyp = new StringBuffer(100);
		
		int pocetPrvocisel;
		int prvocisla[];
		int x, y, cislo, j, i;
		
		while (true) {
		
			pocetPrvocisel = sc.nextInt();
			
			if (pocetPrvocisel == 0) break;
			
			prvocisla = new int[pocetPrvocisel];
		
			for (i = 0; i < pocetPrvocisel; i++)
			{
				prvocisla[i] = sc.nextInt();
			}
		
			x = sc.nextInt();
			y = sc.nextInt();
		
			vyp.setLength(0);

			for (i = x; i <= y; i++)
			{
				cislo = i;
			
	
			
				
				for (j = 0; j < pocetPrvocisel; j++) {
				
					while(true) {
						if ( cislo % prvocisla[j] == 0 ) {
							cislo /= prvocisla[j];
						} else break;
					}	
				
				}
			
				if (cislo == 1)
				{
					vyp.append(i);
					vyp.append(", ");
				
				}
			
			}
		
			if (vyp.length() == 0)
			{
				vyp.append("none");
			} else {
				//vyp = vyp.substring(0, vyp.length() -2);
				vyp.setLength(vyp.length() -2 );
			}
		
			System.out.print(vyp);
			System.out.println();
		
		}
	}
}

