import java.util.*;

public class pp {
	
	static ArrayList<Integer> allPrimes;
	
	private static void createPrimes() {
		allPrimes = new ArrayList<Integer>();
		
		boolean[] temp = new boolean[46350];
		int top = 220;
		
		temp[0] = true;
		temp[1] = true;
		
		for (int i = 2; i < top; i ++) {
			if (temp[i]) {
				continue;
			}
			int j = i * 2;
			do {
				temp[j] = true;
				j += i;
			}
			while (j < temp.length);
		}
		
		for (int i = 0; i < temp.length; i++) {
			if (!temp[i]) {
				allPrimes.add(i);
			}
		}			
	}
	
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		String line;
		
		createPrimes();

				
		while (sc.hasNextLine())
		{
			int primeCount = sc.nextInt();
			
			if (primeCount == 0) return;
			
			sc.nextLine();
			
			int[] myPrimes = new int[primeCount];
			
			for (int i = 0; i < primeCount; i++)
			{
				myPrimes[i] = sc.nextInt();
			}
			
			sc.nextLine();
			int a= sc.nextInt();
			int b= sc.nextInt();
			sc.nextLine();
			
			ArrayList<Integer> res = new ArrayList<Integer>();
						
			for (int i = a; i <= b; i++)
			{
				boolean ok = true;
				for (int j = 0; j < allPrimes.size() && allPrimes.get(j) <= b; j++) {
					
					if (i % allPrimes.get(j) == 0) {
						if (Arrays.binarySearch(myPrimes, allPrimes.get(j)) < 0) {
							ok = false;
							break;
						}
					}
					
				}
				if (ok) {
						res.add(i);
					}
			}
			
			for (int i = 0; i < res.size(); i++) {
				System.out.print(res.get(i));
				if (i != res.size() - 1) {
					System.out.print(",");
				}
			}
			if (res.size() == 0) System.out.print("none");
			System.out.println();
						
			
		}

		
	}
}