#Lutece1272. Final Pan's prime numbers

Final Pan's prime numbers

Migrated from Lutece 1272 Final Pan's prime numbers

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Final Pan likes prime numbers very much.

One day, he want to find the super prime numbers.A prime numbers nn(nn>4) is a super prime number only if nn-4 and nn+4 are both prime numbers,too.

Your task is really easy:Give NN,find the maximum super prime number nn that nn<=NN.

Input

Only one integer N.(4<N<1012)N.( 4<N<10^{12} )

Output

If there is no such interger nn,print'1-1',otherwise print nn.

Samples

8
7

Resources

第七届ACM趣味程序设计竞赛第四场(正式赛)