Problem: Ramkumar loves to solve riddles one day SpojSathyagave him a riddle to solve.
Sathya  will give him pair of integers a and b. Ramkumar has to find the largest
number in the range [a,b] inclusive which can be represented as product of atleast two prime numbers. But ramkumar is busy in watching "Arrow" he is asking your help. Help him to find the largest such number in that range. 

Input format:

	The first line will have a integer T. 
	Next T lines will have a pair of numbers a and b. 
Output format: 
	For each testcase print in a single line the largest number in the range that
satisfies the above condition else if you can't find such number print "-1".

Constraints: 
	1<=T<=100 (for each testcase file) 
	2<=a<=b<=10^12 
Sample Input: 
	2
	5 11
	7 35
Sample Output:
	10 
	35

Solution (in PYTHON):

Solution:
def isprime(n):
  if n == 2 or n == 3: return 0
  if n < 2 or n%2 == 0: return 1
  if n < 9: return 0
  if n%3 == 0: return 1
  r = int(n**0.5)
  f = 5
  while f <= r:
    if n%f == 0: return 1
    if n%(f+2) == 0: return 1
    f +=6
  return 0
    
def main():
    t=raw_input()
    for j in xrange(int(t)):
        b,c=map(long,raw_input().split())
        k=c
        while k<=c and k>=b:
        #for k in range(c,b-1,-1):
            if k<=3:
                print -1
                break
            if k%2==0:
                print k
                break
            if isprime(k)==1:
                print k
                break
            k=k-1
        else:
            print -1
            
if __name__ == '__main__':
    main()