#P6030. Prime Distance

Prime Distance

Description

给定两个整数 L,RL,R,求闭区间 [L,R][L,R] 中相邻两个质数差值最小的数对与差值最大的数对。当存在多个时,输出靠前的素数对。

Input Format

多组数据。每行两个数 L,RL,R

Output Format

详见输出样例。

Sample

样例输入

2 17
14 17

样例输出

2,3 are closest, 7,11 are most distant.
There are no adjacent primes.

Hint

对于全部数据,1L<R<231,RL1061\le L\lt R\lt 2^{31},R-L\le 10^6