1.

/*
* ACM Contest training
* Problem: 914 - Jumping Champion
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=855
*
* @author Patrick Bedat, Philippe Brousse, Christoph Goettschkes
* @version 1.0, 11/14/2010
*
* Method : Sieve of Eratosthenes
* Status : Accepted
* Runtime: 0.232
*/

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.*;

class Main
{
static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

static BitSet primeSet = new BitSet(1000001);
static List<Integer> primeList = new ArrayList<Integer>();

public static void main(String[] agrs) throws IOException
{
sieve();
int testCases = Integer.parseInt(reader.readLine());

for (int curCase = 0; curCase < testCases; curCase++) {
String[] line = reader.readLine().split(" ");
int from = Integer.parseInt(line[0]);
int to = Integer.parseInt(line[1]);

if (from > to) {
int temp = to;
to = from;
from = temp;
}

int fromPrime = from;
for (int i = from; i <= to; i++)
if (!primeSet.get(i)) {
fromPrime = i;
break;
}

int toPrime = to;
for (int i = to; i >= from; i--)
if (!primeSet.get(i)) {
toPrime = i;
break;
}

if (primeSet.get(toPrime) || fromPrime == toPrime) {
System.out.println("No jumping champion");
continue;
}

int start = Collections.binarySearch(primeList, fromPrime);
int end = Collections.binarySearch(primeList, toPrime);
int[] divs = new int[primeList.get(end) - primeList.get(start) + 1];

boolean champ = false;
int maxDivs = 0;
int index = 0;

for (int i = start; i < end; i++) {
int div = primeList.get(i + 1) - primeList.get(i);
divs[div]++;
if (maxDivs < divs[div])
{
maxDivs = divs[div];
index = div;
champ = true;
} else if (maxDivs == divs[div])
champ = false;
}

if (champ)
System.out.println("The jumping champion is " + index);
else
System.out.println("No jumping champion");

}
}

static void sieve() {
int max = 1000000;
int root = (int) Math.sqrt(1000001);
primeSet.set(1, true);
primeSet.set(0, true);
for (int m = 2; m <= root; m++)
if (!primeSet.get(m))
for (int k = m*m; k <= max; k += m)
primeSet.set(k, true);

for (int m = 2; m <= max; m++)
if (!primeSet.get(m))
primeList.add(m);
}
}