In the kingdom of MAPS, the royal archives contain a sequence of scrolls numbered from to
. The Prime Minister (literally a minister obsessed with prime numbers) has devised a new Prime Security Protocol to ensure the archives remain safe from spies.
The protocol states that for every window of exactly consecutive scrolls, there must be at least
prime-numbered scrolls to ensure numerical purity. If a spy tries to extract knowledge from the archives, they will always encounter a sufficient number of prime scrolls in any section, dismantling their evil plans.
As the kingdom's Chief Mathematician, you must determine the smallest possible that satisfies this protocol. If there exists no valid
, report
to the Prime Minister.
Input
A single line containing three integers ,
,
.
Output
A single line containing one integer (if it exists) or
.
Constraints
Example 1
Input
2 4 2
Output
3
Example 2
Input
2 4 3
Output
-1
Example 3
Input
6 13 1
Output
4
Comments