I try this so far:

(1st try : Wrong answer in test case 2 )

```
for _ in range(int(input())):
l,r = map(int,input().split())
if r%l==0 and l != 1:
print(l,r,sep=" ")
else:
if r-l > l:
c = (r-l)//2
if l < 2:
print(2,c,sep=" ")
else:
print(2*(l//2)+2,c,sep=" ")
else:
print(-1,-1,sep=" ")
```

(2nd try : Runtime error in test case 2 )

```
import random
import math
def lcm(a, b):
return abs(a*b) // math.gcd(a, b)
def cool(x,y,l,r):
if l <= x and l < y and x < r and y <= r:
if l <= lcm(x,y) and lcm(x,y) <= r:
return True
for _ in range(int(input())):
l,r = map(int,input().split())
if r%l==0 and l != 1:
print(l,r,sep=" ")
else:
if r - l > l:
while (True):
x = random.randrange(l, r)
y = random.randrange(x+1, r)
if cool(x, y, l, r) == True:
print(x, y, sep=" ")
break
else:
print(-1, -1, sep=" ")
```

Here is the original link from codeforces.

Can you please share your way that you will use to solve this problem?