import java.io.*;
import java.lang.*;
import java.util.*;

public class pp {

  static StreamTokenizer tokenizer;

  static long nextInt() throws IOException {
    
    while (tokenizer.nextToken()!=StreamTokenizer.TT_NUMBER) {	
     
    }
    return (long)tokenizer.nval;

  }

  static SortedSet<Integer> done = new TreeSet<Integer>();
  static SortedSet<Integer> todo = new TreeSet<Integer>();

  public static void main(String[] args) throws IOException {

    tokenizer = new StreamTokenizer(new InputStreamReader(System.in));
    
    int n;
    while ((n = (int)nextInt())!=0) {
    
       

       todo.clear();
      firstNumber = true;

       for (long i = 0; i < n; i++) {
	  todo.add((int)nextInt());
       }
            
       int min = (int)nextInt();
       int max = (int)nextInt();
       
	if (jeTezky(n, min, max)) {
      //    System.out.println("tezky");

	  for (int cis = min; cis <= max; cis++) {	     
		int c2 = cis;
		for (int i : todo) {		
		    while (c2%i==0) {
			    c2/=i;    
		    }    
		}
	      if (c2==1) {
		  sout(cis, 2);
	      }
	  }

	}else{
         while (!todo.isEmpty()) {
	  int first = todo.first();
	  while (!todo.isEmpty()) {
	    int second = todo.first();
	    long mul = first*second;
	    if (mul<=max) { 
	      todo.add((int)mul);
	    }
	    todo.remove(second);
	    done.add(second);
	  }
	  todo = done;
	  done = new TreeSet<Integer>();
	  todo.remove(first);
	  if (min<=first) {
	      sout(first, min);
	  }
       }
      }
   
        
      if (firstNumber) {
	System.out.print("none");
      }

      System.out.println();
      

//      System.out.println(Arrays.toString(params));

    }

  }

  static boolean firstNumber = true;


  static boolean jeTezky(int n, long min, long max) {
    long m = (long)(Math.log10(1<<30)/Math.log(todo.first()));
    return (Math.pow(m+n-1, n-1)/fact(n-1)>200000) ;
    //return (n >= 5);
  }

  static long fact(long num) {
    if (num == 0) {
      return 1;
    } else {
      return num * fact(num - 1);
    }

  }

  static void sout(int number, long min) {
      if (firstNumber) {
	firstNumber = false;
        if (min == 1) {
	  System.out.print("1,");
	}
	System.out.print("" + number);
      } else {
	System.out.print("," + number);
      }
    
  }

  public static int toInt(String text) {
    return Integer.parseInt(text);
  }

  public static int[] toInts(String[] texts) {
      int[] nums = new int[texts.length];
      for (int i = 0; i<texts.length; i++) {
	nums[i] = toInt(texts[i]);
      }
    return nums;
  }


}