def prime n1 n2 if n1 n1 lista filter lambda and and and xrange n1 n2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
def prime(n1,n2):
if n1<=1: n1=2
lista = filter(lambda x: (x % 2 != 0 and x % 5 != 0 and x % 3 != 0 and x % 7 != 0), xrange(n1, n2))
if n1<=10:
for i in (2,3,5,7):
if n2>=10:
if i in xrange(n1,10):print i
else:
if i in xrange(n1,n2+1):print i
print '\n'.join(map(str,lista))
t = input()
m,n = [],[]
for i in xrange(t):
z = raw_input().split()
m.append(z[0]), n.append(z[1])
for i in xrange(t):
prime(int(m[i]), int(n[i]))
print