# your code goes here
from math import floor, sqrt
from operator import mul
from functools import reduce, partial
from itertools import chain, combinations, product as cartesian

def product(it):
	return reduce(mul, it, 1)

def factors(n):
	n = floor(n)
	
	while not n%2:
		yield 2
		n //= 2
		if n <= 1: break
	
	for f in range(3, floor(sqrt(n))+1, 2):
		while not n%f:
			yield f
			n //= f
			if n <= 1: break
	else:
		if n > 1: yield n

def int_divs(n):
	facts = tuple(factors(n))
	return map(
		product,
		chain.from_iterable(
			map(partial(combinations, facts), range(1, 1+len(facts)))
		)
	)

N, M, L, R = map(int, input().split())

pairs = [p
	for p in set(cartesian(int_divs(N), int_divs(M)))
	if L < mul(*p) < R
]

print(*pairs, sep=' ')