Count Transformations#12250

Count Transformations

1 second
256 megabytes
Easy

Given an integer of length , you can perform these types of operations on each digit any number of times :

How many different integers can we produce? Since the count may be too large , print it modulus .

Input

The first line contains single integer (1 \le t \le 10^4) – the number of test cases.

The first line of each test case contains single integer (1 \le n \le 10^5) – the length of integer .

The second line of each test case contains single integer (1 \le x < 10^{100000}) – the integer .

It's guaranteed that \sum n \le 10^5 overall tests.

Output

For each test case output the count of different integers modulus .

Examples

Example 1

Loading
Loading

Note

In the first test case , the different integers are :

Scoring

  1. Subtask ( points) : (n=1).

  2. Subtask ( points) : (n \le 4)

  3. Subtask ( points) : (x_1=x_2=....=x_n).

  4. Subtask ( points) : (n \le 10)

  5. Subtask ( points) : (n \le 1000).

  6. Subtask ( points) : No additional constraints