When asked what his Favorite Number is, Joey cannot respond! He likes a lot of numbers! In particular, he has a list of numbers that are his Favorite Numbers. Numbers might appear more than once on his list of Favorite Numbers, but that's okay, since it means that he really, really likes that number.

Joey is given numbers, but these numbers might not be one his Favorite Numbers. For each number that he is given, he would like the *smallest* Favorite Number that is at least as large as the number he is given. He would also like to know how many times that Favorite Number appears in his list of Favorite Numbers.

Please help Joey!

#### Input Specification

The first line will contain : the size of Joey's list of Favorite Numbers.

The next line will contain space-separated integers: the numbers that are in Joey's list of Favorite Numbers, in no particular order.

The next line will contain : the amount of numbers Joey is given.

lines of input will follow. Each line will contain one integer: one number that Joey is given.

The absolute value of any integer will not exceed . It is guaranteed that no number given to Joey will exceed the largest number in his list.

#### Output Specification

On separate lines, for each number that Joey is given, output two space-separated integers: the smallest Favorite Number that is at least as large as the number given, and how many times it appears in Joey's list of Favorite Numbers.

#### Sample Input

```
10
-2 8 -100 19 -2 -2 8 -100 8 8
5
6
8
17
-1000
-10
```

#### Sample Output

```
8 4
8 4
19 1
-100 2
-2 3
```

## Comments

Data structures tag seems more appropriate.

GrammarThe first sentence of the second paragraph.

The time limit for this problem has been increased to 4 seconds and the memory limit has been increased to 256 MB in order to allow correct submissions in slower languages (such as Java and Python) to pass.

Or only the smallest favourite number greater than the given number?

Sorry, did not realize that. The problem description has been updated.

I solved for the smallest favourite number greater than the given number, and it worked. So probably just the smallest favourite number, greater than the given number.