Primes in an Interval

MediumProblem #25
Time LimitMemoryInputOutput
1 s64 MBstdinstdout

The sum of primes is bigger than the largest int.

For each of intervals , determine how many prime numbers it contains and what their sum is. Since the sum can be a large number, print only its remainder modulo .

Input

First line of input will be a single integer - the number of testcases.
Each of the next lines contains two integers and - the ends of an interval.

Output

For every testcase print a single line with two numbers separated by a space: the number of primes in and their sum modulo .

Example

Input
1
1 1000
Output
168 76127

There are primes up to and their sum is .

Constraints



This problem was adapted, with permission, from Eratostenovo sito, authored by Društvo matematičara Srbije and Fondacija Petlja.

Submit your solution