def solution(n):
answer = False
cnt = 0
if (n != 1):
for i in range(2, n):
if (n % i == 0):
cnt += 1
if (cnt == 0):
answer = True
return answer
M = int(input())
N = int(input())
arr = [i for i in range(M, N+1) if solution(i) == True]
if (len(arr) == 0):
print(-1)
else:
print(sum(arr))
print(min(arr))
없음