Nuske has a grid with N rows and M columns of squares. The rows are numbered 1 through N from top to bottom, and the columns are numbered 1 through M from left to right. Each square in the grid is painted in either blue or white. If S_{i,j} is 1, the square at the i-th row and j-th column is blue; if S_{i,j} is 0, the square is white. For every pair of two blue square a and b, there is at most one path that starts from a, repeatedly proceeds to an adjacent (side by side) blue square and finally reaches b, without traversing the same square more than once.

Phantom Thnook, Nuske's eternal rival, gives Q queries to Nuske. The i-th query consists of four integers x_{i,1}, y_{i,1}, x_{i,2} and y_{i,2} and asks him the following: when the rectangular region of the grid bounded by (and including) the x_{i,1}-th row, x_{i,2}-th row, y_{i,1}-th column and y_{i,2}-th column is cut out, how many connected components consisting of blue squares there are in the region?

Process all the queries.

Constraints

* 1 ≤ N,M ≤ 2000
* 1 ≤ Q ≤ 200000
* S_{i,j} is either 0 or 1.
* S_{i,j} satisfies the condition explained in the statement.
* 1 ≤ x_{i,1} ≤ x_{i,2} ≤ N(1 ≤ i ≤ Q)
* 1 ≤ y_{i,1} ≤ y_{i,2} ≤ M(1 ≤ i ≤ Q)

Input

The input is given from Standard Input in the following format:

N M Q
S_{1,1}..S_{1,M}
:
S_{N,1}..S_{N,M}
x_{1,1} y_{i,1} x_{i,2} y_{i,2}
:
x_{Q,1} y_{Q,1} x_{Q,2} y_{Q,2}

Output

For each query, print the number of the connected components consisting of blue squares in the region.

Examples

Input

3 4 4
1101
0110
1101
1 1 3 4
1 1 3 1
2 2 3 4
1 2 2 4

Output

3
2
2
2

Input

5 5 6
11010
01110
10101
11101
01010
1 1 5 5
1 2 4 5
2 3 3 4
3 3 3 3
3 1 3 5
1 1 3 4

Output

3
2
1
1
3
2


You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x?

Constraints

* 0 ≤ a ≤ b ≤ 10^{18}
* 1 ≤ x ≤ 10^{18}

Input

The input is given from Standard Input in the following format:

a b x

Output

Print the number of the integers between a and b, inclusive, that are divisible by x.

Examples

Input

4 8 2

Output

3

Input

0 5 1

Output

6

Input

9 9 2

Output

0

Input

1 1000000000000000000 3

Output

333333333333333333


12:17 (UTC): The sample input 1 and 2 were swapped. The error is now fixed. We are very sorry for your inconvenience.

There are N children in AtCoder Kindergarten, conveniently numbered 1 through N. Mr. Evi will distribute C indistinguishable candies to the children.

If child i is given a candies, the child's happiness will become x_i^a, where x_i is the child's excitement level. The activity level of the kindergarten is the product of the happiness of all the N children.

For each possible way to distribute C candies to the children by giving zero or more candies to each child, calculate the activity level of the kindergarten. Then, calculate the sum over all possible way to distribute C candies. This sum can be seen as a function of the children's excitement levels x_1,..,x_N, thus we call it f(x_1,..,x_N).

You are given integers A_i,B_i (1≦i≦N). Find <image> modulo 10^9+7.

Constraints

* 1≦N≦400
* 1≦C≦400
* 1≦A_i≦B_i≦400 (1≦i≦N)

Input

The input is given from Standard Input in the following format:

N C
A_1 A_2 ... A_N
B_1 B_2 ... B_N

Output

Print the value of <image> modulo 10^9+7.

Examples

Input

2 3
1 1
1 1

Output

4

Input

1 2
1
3

Output

14

Input

2 3
1 1
2 2

Output

66

Input

4 8
3 1 4 1
3 1 4 1

Output

421749

Input

3 100
7 6 5
9 9 9

Output

139123417


The problem of hiding a part of a formula and searching for the hidden number is called verbal arithmetic. This time, I'm dealing with an expression in which some numbers in the expression are hidden by X. Enter the following formula and create a program that outputs the result.

Formula

* A simple one-line addition expression in the form of "number string + number string = number string".
* A "number sequence" is a sequence of numbers 0-9 and the letter X.
* It is assumed that the leftmost number in the "number string" with two or more digits is not 0.
* X must be at least one in the entire formula.

result

* The answer to the verbal arithmetic. It is one of 0 to 9 with a value of X such that the formula holds. Suppose there are no more than one answer.
* If there is no answer, the result should be “NA”.

Input

Given multiple datasets. For each dataset, an addition expression containing one or more Xs (a string of up to 126 characters without spaces) is given on one line. The number of datasets does not exceed 150.

Output

For each data set, output the result of the verbal arithmetic on one line. Print the numbers 0-9 or NA.

Example

Input

123+4X6=X79
12X+4X6=X79
XX22+89=X2XX

Output

5
NA
1


Takeshi, who loves hot springs, is planning a trip to a hot spring resort on his next long vacation. I would like to travel by connecting to a long-distance bus and reach my destination with as little money as possible. Takeshi, who has savings but is unwilling to pay, decided to consult with his grandfather. The grandfather, who was impressed by the plan, gave Takeshi a special ticket.

The ticket was that you could ride two consecutive sections of a long-distance bus only once for free. Depending on how you use it, you can expect a considerable reduction in travel costs, but you need to make a solid plan in order to achieve a greater effect.

A total of n departure points, destinations, and relay points, and m lines connecting the two points are given. Each point is assigned a number from 1 to n. The starting point is 1 and the destination is n. Route information is represented by the two points a and b that connect the route and its fare c. Due to the special ticket validity, you can pass two consecutive lines from any point at no charge. However, passing through the destination on the way does not mean that you have reached the destination.

Create a program that outputs the minimum fare by inputting the total number of departure points, destinations, and relay points n, the number of routes m, and the information of each route. However, there must always be a route from the origin to the destination.

input

Given multiple datasets. The end of the input is indicated by two lines of zeros. Each dataset is given in the following format:

n m
a1 b1 c1
a2 b2 c2
::
am bm cm

The first line gives the total number of origins, destinations, and transit points n (2 ≤ n ≤ 100) and the number of routes m (1 ≤ m ≤ 300). The following m lines give information for each line ai, bi, ci (1 ≤ ci ≤ 1000).

The number of datasets does not exceed 40.

output

Prints the minimum charge on one line for each input dataset.

Example

Input

2 1
1 2 5
3 2
1 2 5
2 3 5
6 9
1 2 7
1 3 9
1 5 14
2 3 10
2 4 15
3 4 11
3 5 2
4 5 9
4 6 8
0 0

Output

5
0
7


The dice are placed in the orientation shown in the figure below.

<image>

As shown in this figure, the dice used here have 1 on the upper side and 2 on the south side, and 3 on the east side. Since the sum of the facing faces of the dice is always 7, the invisible faces are 5 on the north side, 4 on the west side, and 6 on the bottom side, respectively.

From this initial arrangement, move the dice according to the instructions. However, the instruction is to perform the following six operations several times.

<image> | <image> | <image> | <image>
--- | --- | --- | ---
<image> | <image> | |

The North, East, South, and West operations rotate the dice 90 degrees in the indicated direction. The two operations, Right and Left, rotate 90 degrees horizontally while keeping the upper and lower surfaces unchanged. (Be careful of the direction of rotation.)

The initial value is the number of eyes 1 that appears on the upper surface in the initial arrangement, and after each operation, the number of eyes that appear on the upper surface is added, and all operations are completed according to the instructions. Create a program that outputs the total value of the above.

The first line of the input file contains the total number of instructions n, and each of the following n lines contains one of the "North, East, South, West, Right, Left" instructions. Let. However, n ≤ 10000.

Input example 1 | Input example 2
--- | ---
5 | 8
North | West
North | North
East | Left
South | South
West | Right
| North
| Left
| East
Output example 1 | Output example 2
21 | 34

input

The input consists of multiple datasets. Input ends when n is 0. The number of datasets does not exceed 5.

output

The total value is output to one line for each data set.

Example

Input

5
North
North
East
South
West
8
West
North
Left
South
Right
North
Left
East
0

Output

21
34


Let's solve the puzzle by programming.

The numbers n x n are arranged in a grid pattern. Some of the numbers are circled and we will call them the starting point. The rules of the puzzle are as follows:

* Draw one line that goes vertically and horizontally from each starting point (cannot be drawn diagonally).
* Extend the line so that the sum of the numbers passed is the same as the starting number.
* The line must not be branched.
* Lines cannot pass through numbers already drawn (lines must not intersect).
* A line cannot pass through more than one origin.

As shown in the figure below, the goal of the puzzle is to use all the starting points and draw lines on all the numbers.

<image>

Your job is to create a puzzle-solving program. However, in this problem, it is only necessary to determine whether the given puzzle can be solved.

Input

The input consists of multiple datasets. The format of each dataset is as follows:

n
n x n numbers

Indicates a puzzle given a number of n x n, the starting number is given as a negative number.

When n is 0, it indicates the end of input.

It can be assumed that n is 3 or more and 8 or less, numbers other than the starting point are 1 or more and 50 or less, and the starting point is -50 or more and -1 or less. You may also assume the following as the nature of the puzzle being entered:

* Each row and column of a given puzzle has at least one starting point.
* The number of starting points is about 20% to 40% of the total number of numbers (n x n).

Output

For each dataset, print "YES" if the puzzle can be solved, otherwise "NO" on one line.

Example

Input

3
-3 1 1
2 -4 1
2 1 -1
3
-4 1 1
1 1 -6
1 -5 3
4
-8 6 -2 1
2 -7 -2 1
1 -1 1 1
1 1 1 -5
6
2 2 3 -7 3 2
1 -10 1 1 3 2
2 6 5 2 -6 1
3 4 -23 2 2 5
3 3 -6 2 3 7
-7 2 3 2 -5 -13
6
2 2 3 -7 3 2
1 -10 1 1 3 2
2 6 5 2 -6 1
3 4 -23 2 2 5
3 3 -6 2 3 7
-7 2 3 2 -5 -12
0

Output

YES
NO
NO
YES
NO


There is a chain consisting of multiple circles on a plane. The first (last) circle of the chain only intersects with the next (previous) circle, and each intermediate circle intersects only with the two neighboring circles.

Your task is to find the shortest path that satisfies the following conditions.

* The path connects the centers of the first circle and the last circle.
* The path is confined in the chain, that is, all the points on the path are located within or on at least one of the circles.

Figure E-1 shows an example of such a chain and the corresponding shortest path.

<image>

Figure E-1: An example chain and the corresponding shortest path

Input

The input consists of multiple datasets. Each dataset represents the shape of a chain in the following format.

> n
>  x1 y1 r1
>  x2 y2 r2
>  ...
>  xn yn rn
>

The first line of a dataset contains an integer n (3 ≤ n ≤ 100) representing the number of the circles. Each of the following n lines contains three integers separated by a single space. (xi, yi) and ri represent the center position and the radius of the i-th circle Ci. You can assume that 0 ≤ xi ≤ 1000, 0 ≤ yi ≤ 1000, and 1 ≤ ri ≤ 25.

You can assume that Ci and Ci+1 (1 ≤ i ≤ n−1) intersect at two separate points. When j ≥ i+2, Ci and Cj are apart and either of them does not contain the other. In addition, you can assume that any circle does not contain the center of any other circle.

The end of the input is indicated by a line containing a zero.

Figure E-1 corresponds to the first dataset of Sample Input below. Figure E-2 shows the shortest paths for the subsequent datasets of Sample Input.

<image>

Figure E-2: Example chains and the corresponding shortest paths

Output

For each dataset, output a single line containing the length of the shortest chain-confined path between the centers of the first circle and the last circle. The value should not have an error greater than 0.001. No extra characters should appear in the output.

Sample Input

10
802 0 10
814 0 4
820 1 4
826 1 4
832 3 5
838 5 5
845 7 3
849 10 3
853 14 4
857 18 3
3
0 0 5
8 0 5
8 8 5
3
0 0 5
7 3 6
16 0 5
9
0 3 5
8 0 8
19 2 8
23 14 6
23 21 6
23 28 6
19 40 8
8 42 8
0 39 5
11
0 0 5
8 0 5
18 8 10
8 16 5
0 16 5
0 24 5
3 32 5
10 32 5
17 28 8
27 25 3
30 18 5
0

Output for the Sample Input

58.953437
11.414214
16.0
61.874812
63.195179

Example

Input

10
802 0 10
814 0 4
820 1 4
826 1 4
832 3 5
838 5 5
845 7 3
849 10 3
853 14 4
857 18 3
3
0 0 5
8 0 5
8 8 5
3
0 0 5
7 3 6
16 0 5
9
0 3 5
8 0 8
19 2 8
23 14 6
23 21 6
23 28 6
19 40 8
8 42 8
0 39 5
11
0 0 5
8 0 5
18 8 10
8 16 5
0 16 5
0 24 5
3 32 5
10 32 5
17 28 8
27 25 3
30 18 5
0

Output

58.953437
11.414214
16.0
61.874812
63.195179


The committee members of the Kitoshima programming contest had decided to use crypto-graphic software for their secret communication. They had asked a company, Kodai Software, to develop cryptographic software that employed a cipher based on highly sophisticated mathematics.

According to reports on IT projects, many projects are not delivered on time, on budget, with required features and functions. This applied to this case. Kodai Software failed to implement the cipher by the appointed date of delivery, and asked to use a simpler version that employed a type of substitution cipher for the moment. The committee members got angry and strongly requested to deliver the full specification product, but they unwillingly decided to use this inferior product for the moment.

In what follows, we call the text before encryption, plaintext, and the text after encryption, ciphertext.

This simple cipher substitutes letters in the plaintext, and its substitution rule is specified with a set of pairs. A pair consists of two letters and is unordered, that is, the order of the letters in the pair does not matter. A pair (A, B) and a pair (B, A) have the same meaning. In one substitution rule, one letter can appear in at most one single pair. When a letter in a pair appears in the plaintext, the letter is replaced with the other letter in the pair. Letters not specified in any pairs are left as they are.

For example, by substituting the plaintext

ABCDEFGHIJKLMNOPQRSTUVWXYZ

with the substitution rule {(A, Z), (B, Y)} results in the following ciphertext.

ZYCDEFGHIJKLMNOPQRSTUVWXBA

This may be a big chance for us, because the substitution rule seems weak against cracking. We may be able to know communications between committee members. The mission here is to develop a deciphering program that finds the plaintext messages from given ciphertext messages.

A ciphertext message is composed of one or more ciphertext words. A ciphertext word is generated from a plaintext word with a substitution rule. You have a list of candidate words containing the words that can appear in the plaintext; no other words may appear. Some words in the list may not actually be used in the plaintext.

There always exists at least one sequence of candidate words from which the given ciphertext is obtained by some substitution rule. There may be cases where it is impossible to uniquely identify the plaintext from a given ciphertext and the list of candidate words.

Input

The input consists of multiple datasets, each of which contains a ciphertext message and a list of candidate words in the following format.

n
word1
.
.
.
wordn
sequence

n in the first line is a positive integer, representing the number of candidate words. Each of the next n lines represents one of the candidate words. The last line, sequence, is a sequence of one or more ciphertext words separated by a single space and terminated with a period.

You may assume the number of characters in each sequence is more than 1 and less than or equal to 80 including spaces and the period. The number of candidate words in the list, n, does not exceed 20. Only 26 uppercase letters, A to Z, are used in the words and the length of each word is from 1 to 20, inclusive.

A line of a single zero indicates the end of the input.

Output

For each dataset, your program should print the deciphered message in a line. Two adjacent words in an output line should be separated by a single space and the last word should be followed by a single period. When it is impossible to uniquely identify the plaintext, the output line should be a single hyphen followed by a single period.

Example

Input

4
A
AND
CAT
DOG
Z XUW ZVX Z YZT.
2
AZ
AY
ZA.
2
AA
BB
CC.
16
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
ABCDEFGHIJKLMNO
A B C D E F G H I J K L M N O ABCDEFGHIJKLMNO.
0

Output

A DOG AND A CAT.
AZ.
-.
A B C D E F G H I J K L M N O ABCDEFGHIJKLMNO.


Background

The kindergarten attached to the University of Aizu is a kindergarten where children who love programming gather. Yu, one of the kindergarten children, loves lowercase letters as much as programming. Yu-kun decided to write a scoring program for a new play that uses paper, circles, lines, and lowercase letters.

Problem

Initially, V circles and E lines are drawn on the paper. The circles are numbered from 0 in ascending order, with one lowercase letter or nothing in each circle. Each line connects two different circles. A circle cannot be connected by more than 26 lines.

The play procedure is as follows.

1. Select one circle with nothing written on it. If such a circle does not exist, this process ends.
2. Write one lowercase letter in the circle. However, if the circle is already connected to a circle with lowercase letters by a line, the same lowercase letters as the lowercase letters cannot be written.
3. Return to 1.

After writing lowercase letters in all the circles according to the above procedure, arrange the lowercase letters in the circles in ascending order of the circle numbers to make a character string. I want to minimize the character strings that can be created in this way in lexicographical order. There are two strings s and t of the same length, and s is smaller than t in lexicographical order in the following cases. si represents the i-th lowercase letter of the string s and ti represents the i-th lowercase letter of the string t. For the smallest i where si differs from ti, si is less than ti.

Since the initial state of the paper is given, output the smallest character string that can be created according to the above procedure in lexicographical order.

Constraints

The input satisfies the following conditions.

* 1 ≤ V ≤ 100,000
* 0 ≤ E ≤ 200,000
* ai is either lowercase or'?' (0 ≤ i ≤ V-1)
* 0 ≤ si, ti ≤ V-1 (si <ti, 0 ≤ i ≤ E-1)
* One circle cannot be connected by more than 26 lines

Input

V E
a0 a1 ... a (V-1)
s0 t0
s1 t1
...
s (E-1) t (E-1)

The number of circles V and the number of lines E are given on the first line, separated by blanks.

The initial state of the circle is given on the second line, separated by blanks.

If ai is a lowercase letter, the lowercase letter is written in the i-th circle, and if it is'?', It means that nothing is written in the i-th circle.

The line information is given as si ti on the following E line, which means that the si and ti circles are connected by a line.

Output

Output the smallest character string in the dictionary order on one line among the character strings that can be created according to the procedure in the question sentence.

Examples

Input

3 3
c ? ?
0 1
0 2
1 2

Output

cab

Input

3 2
c ? ?
0 1
0 2

Output

caa

Input

7 6
? a ? ? z a ?
0 1
0 2
3 4
4 5
4 6
5 6

Output

baaazab

Input

5 0
? ? ? ? ?

Output

aaaaa


You are a member of a secret society named Japanese Abekobe Group, which is called J. A. G. for short. Those who belong to this society often exchange encrypted messages. You received lots of encrypted messages this morning, and you tried to decrypt them as usual. However, because you received so many and long messages today, you had to give up decrypting them by yourself. So you decided to decrypt them with the help of a computer program that you are going to write.

The encryption scheme in J. A. G. utilizes palindromes. A palindrome is a word or phrase that reads the same in either direction. For example, “MADAM”, “REVIVER” and “SUCCUS” are palindromes, while “ADAM”, “REVENGE” and “SOCCER” are not.

Specifically to this scheme, words and phrases made of only one or two letters are not regarded as palindromes. For example, “A” and “MM” are not regarded as palindromes.

The encryption scheme is quite simple: each message is encrypted by inserting extra letters in such a way that the longest one among all subsequences forming palindromes gives the original message. In other words, you can decrypt the message by extracting the longest palindrome subsequence. Here, a subsequence means a new string obtained by picking up some letters from a string without altering the relative positions of the remaining letters. For example, the longest palindrome subsequence of a string “YMAOKDOAMIMHAADAMMA” is “MADAMIMADAM” as indicated below by underline.

<image>

Now you are ready for writing a program.

Input

The input consists of a series of data sets. Each data set contains a line made of up to 2,000 capital letters which represents an encrypted string.

The end of the input is indicated by EOF (end-of-file marker).

Output

For each data set, write a decrypted message in a separate line. If there is more than one decrypted message possible (i.e. if there is more than one palindrome subsequence not shorter than any other ones), you may write any of the possible messages.

You can assume that the length of the longest palindrome subsequence of each data set is always longer than two letters.

Example

Input

YMAOKDOAMIMHAADAMMA
LELVEEL

Output

MADAMIMADAM
LEVEL


Maki is a house cat. One day she fortunately came at a wonderful-looking dried fish. Since she felt not hungry on that day, she put it up in her bed. However there was a problem; a rat was living in her house, and he was watching for a chance to steal her food. To secure the fish during the time she is asleep, she decided to build some walls to prevent the rat from reaching her bed.

Maki's house is represented as a two-dimensional plane. She has hidden the dried fish at (xt, yt). She knows that the lair of the rat is located at (xs, ys ). She has some candidate locations to build walls. The i-th candidate is described by a circle of radius ri centered at (xi, yi). She can build walls at as many candidate locations as she wants, unless they touch or cross each other. You can assume that the size of the fish, the rat’s lair, and the thickness of walls are all very small and can be ignored.

Your task is to write a program which determines the minimum number of walls the rat needs to climb over until he can get to Maki's bed from his lair, assuming that Maki made an optimal choice of walls.

Input

The input is a sequence of datasets. Each dataset corresponds to a single situation and has the following format:

n
xs ys xt yt
x1 y1 r1
...
xn yn rn

n is the number of candidate locations where to build walls (1 ≤ n ≤ 1000). (xs, ys ) and (xt , yt ) denote the coordinates of the rat's lair and Maki's bed, respectively. The i-th candidate location is a circle which has radius ri (1 ≤ ri ≤ 10000) and is centered at (xi, yi) (i = 1, 2, ... , n). All coordinate values are integers between 0 and 10000 (inclusive).

All candidate locations are distinct and contain neither the rat's lair nor Maki's bed. The positions of the rat's lair and Maki's bed are also distinct.

The input is terminated by a line with "0". This is not part of any dataset and thus should not be processed.

Output

For each dataset, print a single line that contains the minimum number of walls the rat needs to climb over.

Example

Input

3
0 0 100 100
60 100 50
100 100 10
80 80 50
4
0 0 100 100
50 50 50
150 50 50
50 150 50
150 150 50
0

Output

2
0


Problem statement

$ N $ Line segments $ s_1, s_2, ..., s_N $ are given. At this time, find the minimum possible value of dist $ (s_i, s_j) $, ($ 1 \ leq i, j \ leq N, i \ ne j $). dist $ (s_i, s_j) $ is

* $ \ sqrt {(x_i-x_j) ^ 2 + (y_i-y_j) ^ 2} $, ($ (x_i, y_i) $ is the point above $ s_i $, $ (x_j, y_j) $ is $ s_j $ Above point)

It is defined by the minimum possible value of.

The following is a diagram of the Sample Input dataset.

<image> <image> <image> <image>

Constraint

* $ 2 \ leq N \ leq 10 ^ 5 $
* $ 0 \ leq x_ {i, j}, y_ {i, j} \ leq 100 $
* $ (x_ {i, 1}, y_ {i, 1}) \ neq (x_ {i, 2}, y_ {i, 2}) $

input

Input follows the following format. All given numbers are integers.

$ N $
$ x_ {1,1} $ $ y_ {1,1} $ $ x_ {1,2} $ $ y_ {1,2} $
$ x_ {2,1} $ $ y_ {2,1} $ $ x_ {2,2} $ $ y_ {2,2} $
$ ... $
$ x_ {N, 1} $ $ y_ {N, 1} $ $ x_ {N, 2} $ $ y_ {N, 2} $

$ s_i $ is a line segment whose end point is $ (x_ {i, 1}, y_ {i, 1}) $, $ (x_ {i, 2}, y_ {i, 2}) $.

output

Output the minimum value on one line. The output value must not have an error greater than $ 10 ^ {-5} $.

Examples

Input

4
2 0 2 25
0 30 15 20
16 20 5 15
23 0 23 30

Output

0.41380294

Input

6
0 0 0 5
1 3 3 5
6 0 6 10
7 4 10 4
11 1 11 3
7 0 10 0

Output

1.00000000

Input

6
5 5 5 45
7 45 19 45
7 30 19 30
21 34 21 44
26 45 36 28
45 45 26 5

Output

0.83553169

Input

11
10 10 10 90
10 90 35 90
10 60 35 60
35 60 35 90
40 10 40 90
37 45 60 45
60 10 60 45
65 10 65 90
65 90 90 90
65 60 90 65
90 60 90 90

Output

0.00000000


Problem Statement

Mr. Takatsuki, who is planning to participate in the Aizu training camp, has a poor house and always tries to save as much paper as possible. She decided to play a ghost leg with other participants to decide the team for the Aizu training camp.

How to make Amidakuji for this training camp is as follows. First, write N vertical bars in parallel on the paper. Then, write the M horizontal bars in order from the top so that they are perpendicular to the vertical bars and the heights of the horizontal bars are all different. For example, the Amida of Sample Input 1 is as shown in Fig. 1.

Here, Mr. Takatsuki, a little dissatisfied expression. It's a waste of paper to write a ghost leg so vertically. You should be able to compress the height more. So, I want her to solve the problem of height compression of Amidakuji shown below.

First, the height of the Amidakuji is the value obtained by counting the horizontal bars that exist at the same height together as the height 1 and counting this to the bottom horizontal bar. Here, it is assumed that each horizontal bar can be freely moved up and down in order to perform height compression. However, it is not permissible to remove or add horizontal bars. The Amidakuji after height compression must meet the following conditions.

* The end points of the horizontal bar do not touch the end points of other horizontal bars.
* The result of tracing the Amidakuji after compression and the result of tracing the Amidakuji before compression match.

FIG. 2 is a compressed version of FIG. The "horizontal bar connecting vertical bars 1 and 2" moves to the top and becomes the same height as the "horizontal bar connecting vertical bars 4 and 5", and these two are height 1. After that, the "horizontal bar connecting the vertical bars 3 and 4" and the "horizontal bar connecting the vertical bars 2 and 3" have different heights, and the total height is 3.

<image>

Compress the height of the given Amidakuji and output the compressed height.

Constraints

* 2 <= N <= 8
* 1 <= M <= 8
* 1 <= ai <= N --1

Input

Each data set is input in the following format.

N M
a1
a2
...
aM

All inputs are integers. N indicates the number of vertical bars and M indicates the number of horizontal bars. Then, the information of the horizontal bar is input over M lines. ai indicates that the i-th horizontal bar connects the vertical bar ai and the vertical bar to the right of it. The i-th horizontal bar exists above the i + 1-th horizontal bar.

Output

Outputs the height of the compressed Amidakuji in one line.

Examples

Input

5 4
4
3
1
2

Output

3

Input

4 3
1
2
3

Output

3


Example

Input

4
1 1 2

Output

6


problem

AOR Ika-chan is taking a class where grades are determined only by the score of the $ N $ report. AOR Ika-chan has $ M $ friends who are taking the same class, and if you have a report on a theme that you are not good at, you can get the same score as that friend by copying the report of a friend who is good at that theme. .. However, the teacher should not be aware that you are copying someone else's report, so you have to finish the report yourself, not copying someone else's report at least $ K $ out of $ N $ times. Also, AOR Ika didn't want to bother her friends, so she decided to copy the report to her friend $ i $ less than $ T_i $ times. Answer the maximum total score that AOR Ika can get when given the score when AOR Ika finishes the report by herself and the score when her friend finishes the report.

input

Input is given from standard input in the following format.

$ N \ M \ K $
$ a_1 \ \ cdots \ a_N $
$ b_ {11} \ \ cdots \ b_ {1N} $
$ \ vdots $
$ b_ {M1} \ \ cdots \ b_ {MN} $
$ T_1 \ \ cdots \ T_M $

$ a_i $ is the score when AOR Ika finishes the $ i $ th report, and $ b_ {ij} $ is the score when friend $ i $ finishes the $ j $ th report.

output

Output the maximum total score that AOR Ika can get. Also, output a line break at the end.

Example

Input

3 2 2
50 65 70
80 100 80
90 65 45
1 1

Output

225


B: Hokkaido University Hard

Note

Please note that the question settings are the same as question A, except for the constraints.

story

Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her, a huge campus awaits ...

"Eh ... I'm not in time for the next class ..."

problem

Hokkaido University Sapporo Campus is famous for being unusually large. The Sapporo campus is represented by rectangular squares with H squares vertically and W squares horizontally. We will use (i, j) to represent the cells that are i-mass from the north and j-mass from the west. There are several buildings on campus, with a'B'if there is a building in the location represented by the square (i, j) and a'.' If not, in c_ {i, j}.

Homura, a freshman at Hokkaido University, was surprised at the size of the campus and was worried about moving between buildings. So I was wondering how far the farthest of the two squares with the building were. Here we define the distance between two pairs of squares (i, j), (i', j') as | i-i'| + | j-j'|.

Homura found this problem difficult for him and asked his classmates for help. Please ask for an answer instead of Homura-chan.

Input format

H W
c_ {11} c_ {12} ... c_ {1W}
::
c_ {H1} c_ {H2} ... c_ {HW}

Constraint

* 2 \ leq H, W \ leq 10 ^ 3
* H and W are integers
* c_ {i, j} is either'B'or'.'.
* At least two of c_ {i, j} are'B'.

Output format

Print the integer that represents the answer on one line.

Input example 1

3 3
B.B
..B
.BB

Output example 1

Four

* The longest is between the two points (1,1) and (3,3).

Input example 2

4 3
B ..
B ..
...
...

Output example 2

1

* Adjacent positions may be the longest.

Input example 3

6 6
... B ..
B.B.B.
.B.B.B
... B.B
.B..B.
..B ...

Output example 3

7

Example

Input

3 3
B.B
..B
.BB

Output

4


Bichrome Tree Connectivity

Given a tree.

Initially, all vertices are white.

Inverting the color of the white vertices makes it black, and inverting the color of the black vertices makes it white.

Handle two types of queries.

The first type of query inverts the color of vertex v.

The second type of query answers the number of vertices that can be reached from the white vertices v using only the white vertices and the edges connecting them.

input

N Q
a_1 b_1
a_2 b_2
::
a_ {n-1} b_ {n-1}
t_1 v_1
t_2 v_2
::
t_q v_q

When t_i is 1, it means that it is the first type of query, and when it is 2, it means that it is the second type of query.

output

ans_1
ans_2
::
ans_k

Output the answers to the second type of query in order.

Constraint

* 1 \ leq N, Q \ leq 10 ^ 5
* 1 \ leq a_i, b_i \ leq N
* 1 \ leq t_i \ leq 2
* 1 \ leq v_i \ leq N
* The graph given is a tree.
* When t_i = 2, the vertex v_i is always white.

Input example

10 3
1 2
twenty five
2 6
14
13
3 7
3 8
3 9
9 10
13
twenty one
2 8

Output example

Five
1

Example

Input

10 3
1 2
2 5
2 6
1 4
1 3
3 7
3 8
3 9
9 10
1 3
2 1
2 8

Output

5
1


Write a program which manipulates a sequence A = {a1, a2, . . . , an} with the following operations:

* add(s, t, x): add x to as, as+1, ..., at.
* get(i): output the value of ai.

Note that the initial values of ai (i = 1, 2, . . . , n) are 0.

Constraints

* 1 ≤ n ≤ 100000
* 1 ≤ q ≤ 100000
* 1 ≤ s ≤ t ≤ n
* 1 ≤ i ≤ n
* 0 ≤ x ≤ 1000

Input

n q
query1
query2
:
queryq

In the first line, n (the number of elements in A) and q (the number of queries) are given. Then, ith query queryi is given in the following format:

0 s t x

or

1 t

The first digit represents the type of the query. '0' denotes add(s, t, x) and '1' denotes get(i).

Output

For each get operation, print the value.

Examples

Input

3 5
0 1 2 1
0 2 3 2
0 3 3 3
1 2
1 3

Output

3
5

Input

4 3
1 2
0 1 4 1
1 2

Output

0
1


At the legendary times of Nonsenso wars in ISM Dhanbad, there was a neck to neck competition between Barney Stinson and Sheldon Cooper. They both were on level 19. After trying too hard both of them could not decipher the nonsense, so they decided to play alongside. Sheldon Cooper had to pass a message to Barney Stinson. So he decided to convert each letter of the sentence to their corresponding to their ASCII codes. When Barney received the message he could not get anything. Now you have to design a code which converts the encrypted message to readable format.

Input
The input will consist of the first line containing the number of test cases ‘n’ followed by n lines of test cases.

Output

For each input print the decoded line.

Example

Input:
2
721011081081113287111114108100
871011089911110910132116111327311010010597

Output:
Hello World
Welcome to India


Ayan's favourite musical instrument is the keyboard. He practices regularly as well, you can hear him playing even at 3 or 4 in the night.
Unfortunately, he got into a fight in his room and his keyboard was damaged beyond repair. However, being a rich fellow he quickly ordered another one.
But this time he felt a bit adventurous. He decided to buy a circular keyboard i.e keys are arranged in a circle.
This funky keyboard has only 12 keys though - C,C#,D,D#,E,F,F#,G,G#,A,B and S.
Since the layout is quite different to what he is used to, he needs to relearn basics of music theory again.
Firstly, a semitone is the distance between any two keys. So there are 3 semitones between D and F, and 2 semitones between S and C# (remember it is circular!)
He knows a chord is an unordered set of three or more than three keys. However, Ayan wants to start slow and considers only triads - chords of size 3.
Triads come in two varieties - major and minor. In a major triad the number of semitones between the first and second key is 4, and between the second and third - 3.
Minor triads on the other hand have 3 semitones between the first and second keys, 4 semitones between the second and third one.
For example, D F# A is a major triad, while D F A is minor.
Ayan needs your help classifying some basic triads. Kindly help him.

Input
 The first line of input is the number of test cases T (1<=T<=25).
 The next T lines contain three characters corresponding to the musical keys on the circular keyboard.
 Note that # keys will be given as small letters and normal keys as capital letters. So C# will be given as c, while D will remain D.
 It is guaranteed that the triads will be either major or minor.

Output
 For each test case, print "Major" or "Minor" in a separate line, depending on whether the given triad is major or minor.
Example
 Input:

2
E G S
S d f

 Output:
Minor
Major

Explanation
Example case 1. E and G have a 3 semitone gap, while G and S have a 4 semitone gap. So Minor.
 S and D# have a 4 semitone gap (remember circular) and D# and F# have a 3 semitone gap. So Major.


Sorting is considered to be one of the most important skills to be learned in computer science and has it's applications in real product building.
The problem has arised to the team of PcCube.They need to sort the set of alphanumeric strings in such a way that the positions of alphabets and numbers remains unchanged.

Input
First line of the input contains T , i.e. number of test cases.Then next T lines contains a string S.

Output
Output description.
Output the sorted form of S such that the positions of alphabets and numbers remains unchanged.

Constraints

1 ≤ T ≤ 100
1 ≤ N ≤ 1000000

Example
Input:
1
951f5gd3

Output:
135d5fg9


Given an input sequence. You have to write a program to sort it in non decreasing order.

Input
First line of input T has number of test cases followed by T test cases.
Each test case has two lines. First line has a number N. The second line has N space separated elements as an input sequence

Output
Output has T lines of output corresponding to each test case.
Each line will have space separated integers in non decreasing order.

Example

Input:
3
2
3 4
5
1 4 5 8 2
1
7

Output:
3 4
1 2 4 5 8
7


Chef taught his brother Chefu about right angled triangle and its properties. Chefu says that he has understood everything about right angled triangles. Chef wants to check learning of his brother by asking the following question "Can you find a right angled triangle whose length of hypotenuse  is H and its area is S?"
Chefu is confused how to solve it. I hope you are not. Please solve this by finding a right angled triangle with hypotenuse H and area S. If it not possible to do so, then output -1.

Input
The first line of the input contains a single integer T denoting the number of test-cases. T test cases follow.
For each test case, there will be a single line containing two space separated integers H and S.

Output
Output the answer for each test-case in a single line. If it is not possible to find such a triangle, output -1. Otherwise print 3 real numbers corresponding to the lengths of the sides of the triangle sorted in non-decreasing order. Please note that the length of the triangle sides should not differ by more than 0.01 in absolute value from the correct lengths.

Constraints

1 ≤ T ≤ 10^5
1 ≤ H ≤ 10^6
1 ≤ S ≤ 10^12

Example
Input:
4
5 6
6 10
258303 89837245228
616153 77878145466

Output:
3.00000 4.00000 5.00000
-1
-1
285168.817674 546189.769984 616153.000000


The University management meets every semester to discuss about the issues of the University in a round table conference. Therefore new proposals are made to the present academic curriculum. However whenever a new proposal comes from a member, all the members of the round table, except the adjacent members , throws his/her question for that proposal. It is known that every member has a proposal. Given the total no. of members in a round table meeting, you have to answer the total no. of questions thrown across the table on that particular day. Since the answer may be large, you have to print it in modulo 10^9+7.

Input

First line contains an integer t denoting the number of test cases.
Next line contains an integer n, the number of members who were present on that day.

Output
Print the answer in a new line.

Constraints

1 ≤ t ≤ 1000
1 ≤ n ≤ 10^9

Example
Input:
1
291

Output:
41904


There is a strange peculiarity: if you connect the cities of Rostov, Taganrog and Shakhty, peculiarly, you get a triangle

«Unbelievable But True»

Students from many different parts of Russia and abroad come to Summer Informatics School. You marked the hometowns of the SIS participants on a map.

Now you decided to prepare an interesting infographic based on this map. The first thing you chose to do is to find three cities on this map, such that they form a triangle with area S.

Input

The first line of input contains two integers n and S (3 ≤ n ≤ 2000, 1 ≤ S ≤ 2 ⋅ 10^{18}) — the number of cities on the map and the area of the triangle to be found.

The next n lines contain descriptions of the cities, one per line. Each city is described by its integer coordinates x_i, y_i (-10^9 ≤ x_i, y_i ≤ 10^9).

It is guaranteed that all cities are located at distinct points. It is also guaranteed that no three cities lie on the same line.

Output

If the solution doesn't exist — print «No».

Otherwise, print «Yes», followed by three pairs of coordinates (x, y) — the locations of the three cities, which form the triangle of area S.

Examples

Input

3 7
0 0
3 0
0 4

Output

No

Input

4 3
0 0
2 0
1 2
1 3

Output

Yes
0 0
1 3
2 0


You are given an array a consisting of n integers. You can perform the following operations with it:

  1. Choose some positions i and j (1 ≤ i, j ≤ n, i ≠ j), write the value of a_i ⋅ a_j into the j-th cell and remove the number from the i-th cell;
  2. Choose some position i and remove the number from the i-th cell (this operation can be performed no more than once and at any point of time, not necessarily in the beginning).

The number of elements decreases by one after each operation. However, the indexing of positions stays the same. Deleted numbers can't be used in the later operations.

Your task is to perform exactly n - 1 operations with the array in such a way that the only number that remains in the array is maximum possible. This number can be rather large, so instead of printing it you need to print any sequence of operations which leads to this maximum number. Read the output format to understand what exactly you need to print.

Input

The first line contains a single integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the number of elements in the array.

The second line contains n integers a_1, a_2, ..., a_n (-10^9 ≤ a_i ≤ 10^9) — the elements of the array.

Output

Print n - 1 lines. The k-th line should contain one of the two possible operations.

The operation of the first type should look like this: 1~ i_k~ j_k, where 1 is the type of operation, i_k and j_k are the positions of the chosen elements.

The operation of the second type should look like this: 2~ i_k, where 2 is the type of operation, i_k is the position of the chosen element. Note that there should be no more than one such operation.

If there are multiple possible sequences of operations leading to the maximum number — print any of them.

Examples

Input

5
5 -2 0 1 -3

Output

2 3
1 1 2
1 2 4
1 4 5

Input

5
5 2 0 4 0

Output

1 3 5
2 5
1 1 2
1 2 4

Input

2
2 -1

Output

2 2

Input

4
0 -10 0 0

Output

1 1 2
1 2 3
1 3 4

Input

4
0 0 0 0

Output

1 1 2
1 2 3
1 3 4

Note

Let X be the removed number in the array. Let's take a look at all the examples:

The first example has, for example, the following sequence of transformations of the array: [5, -2, 0, 1, -3] → [5, -2, X, 1, -3] → [X, -10, X, 1, -3] → [X, X, X, -10, -3] → [X, X, X, X, 30]. Thus, the maximum answer is 30. Note, that other sequences that lead to the answer 30 are also correct.

The second example has, for example, the following sequence of transformations of the array: [5, 2, 0, 4, 0] → [5, 2, X, 4, 0] → [5, 2, X, 4, X] → [X, 10, X, 4, X] → [X, X, X, 40, X]. The following answer is also allowed:

    1 5 3
    1 4 2
    1 2 1
    2 3

Then the sequence of transformations of the array will look like this: [5, 2, 0, 4, 0] → [5, 2, 0, 4, X] → [5, 8, 0, X, X] → [40, X, 0, X, X] → [40, X, X, X, X].

The third example can have the following sequence of transformations of the array: [2, -1] → [2, X].

The fourth example can have the following sequence of transformations of the array: [0, -10, 0, 0] → [X, 0, 0, 0] → [X, X, 0, 0] → [X, X, X, 0].

The fifth example can have the following sequence of transformations of the array: [0, 0, 0, 0] → [X, 0, 0, 0] → [X, X, 0, 0] → [X, X, X, 0].


Vasya has got an undirected graph consisting of n vertices and m edges. This graph doesn't contain any self-loops or multiple edges. Self-loop is an edge connecting a vertex to itself. Multiple edges are a pair of edges such that they connect the same pair of vertices. Since the graph is undirected, the pair of edges (1, 2) and (2, 1) is considered to be multiple edges. Isolated vertex of the graph is a vertex such that there is no edge connecting this vertex to any other vertex.

Vasya wants to know the minimum and maximum possible number of isolated vertices in an undirected graph consisting of n vertices and m edges.

Input

The only line contains two integers n and m~(1 ≤ n ≤ 10^5, 0 ≤ m ≤ (n (n - 1))/(2)).

It is guaranteed that there exists a graph without any self-loops or multiple edges with such number of vertices and edges.

Output

In the only line print two numbers min and max — the minimum and maximum number of isolated vertices, respectively.

Examples

Input

4 2

Output

0 1

Input

3 1

Output

1 1

Note

In the first example it is possible to construct a graph with 0 isolated vertices: for example, it should contain edges (1, 2) and (3, 4). To get one isolated vertex, we may construct a graph with edges (1, 2) and (1, 3).

In the second example the graph will always contain exactly one isolated vertex.


Berland forest was planted several decades ago in a formation of an infinite grid with a single tree in every cell. Now the trees are grown up and they form a pretty dense structure.

So dense, actually, that the fire became a real danger for the forest. This season had been abnormally hot in Berland and some trees got caught on fire!

The second fire started is considered the second 0. Every second fire lit up all intact neightbouring trees to every currently burning tree. The tree is neighbouring if it occupies adjacent by side or by corner cell. Luckily, after t seconds Berland fire department finally reached the location of fire and instantaneously extinguished it all.

Now they want to calculate the destructive power of the fire. Let val_{x, y} be the second the tree in cell (x, y) got caught on fire. The destructive power is the sum of val_{x, y} over all (x, y) of burnt trees.

Clearly, all the workers of fire department are firefighters, not programmers, thus they asked you to help them calculate the destructive power of the fire.

The result can be rather big, so print it modulo 998244353.

Input

The first line contains two integers n and t (1 ≤ n ≤ 50, 0 ≤ t ≤ 10^8) — the number of trees that initially got caught on fire and the time fire department extinguished the fire, respectively.

Each of the next n lines contains two integers x and y (-10^8 ≤ x, y ≤ 10^8) — the positions of trees that initially got caught on fire.

Obviously, the position of cell (0, 0) on the grid and the directions of axes is irrelevant as the grid is infinite and the answer doesn't depend on them.

It is guaranteed that all the given tree positions are pairwise distinct.

The grid is infinite so the fire doesn't stop once it reaches -10^8 or 10^8. It continues beyond these borders.

Output

Print a single integer — the sum of val_{x, y} over all (x, y) of burnt trees modulo 998244353.

Examples

Input

1 2
10 11

Output

40

Input

4 1
2 2
1 3
0 2
2 4

Output

18

Input

3 0
0 0
-2 1
1 1

Output

0

Note

Here are the first three examples. The grey cells have val = 0, the orange cells have val = 1 and the red cells have val = 2.

<image>


Lunar New Year is approaching, and Bob received a gift from his friend recently — a recursive sequence! He loves this sequence very much and wants to play with it.

Let f_1, f_2, …, f_i, … be an infinite sequence of positive integers. Bob knows that for i > k, f_i can be obtained by the following recursive equation:

$$$f_i = \left(f_{i - 1} ^ {b_1} ⋅ f_{i - 2} ^ {b_2} ⋅ ⋅⋅⋅ ⋅ f_{i - k} ^ {b_k}\right) mod p,$$$

which in short is

$$$f_i = \left(∏_{j = 1}^{k} f_{i - j}^{b_j}\right) mod p,$$$

where p = 998 244 353 (a widely-used prime), b_1, b_2, …, b_k are known integer constants, and x mod y denotes the remainder of x divided by y.

Bob lost the values of f_1, f_2, …, f_k, which is extremely troublesome – these are the basis of the sequence! Luckily, Bob remembers the first k - 1 elements of the sequence: f_1 = f_2 = … = f_{k - 1} = 1 and the n-th element: f_n = m. Please find any possible value of f_k. If no solution exists, just tell Bob that it is impossible to recover his favorite sequence, regardless of Bob's sadness.

Input

The first line contains a positive integer k (1 ≤ k ≤ 100), denoting the length of the sequence b_1, b_2, …, b_k.

The second line contains k positive integers b_1, b_2, …, b_k (1 ≤ b_i < p).

The third line contains two positive integers n and m (k < n ≤ 10^9, 1 ≤ m < p), which implies f_n = m.

Output

Output a possible value of f_k, where f_k is a positive integer satisfying 1 ≤ f_k < p. If there are multiple answers, print any of them. If no such f_k makes f_n = m, output -1 instead.

It is easy to show that if there are some possible values of f_k, there must be at least one satisfying 1 ≤ f_k < p.

Examples

Input

3
2 3 5
4 16

Output

4

Input

5
4 7 1 5 6
7 14187219

Output

6

Input

8
2 3 5 6 1 7 9 10
23333 1

Output

1

Input

1
2
88888 66666

Output

-1

Input

3
998244352 998244352 998244352
4 2

Output

-1

Input

10
283 463 213 777 346 201 463 283 102 999
2333333 6263423

Output

382480067

Note

In the first sample, we have f_4 = f_3^2 ⋅ f_2^3 ⋅ f_1^5. Therefore, applying f_3 = 4, we have f_4 = 16. Note that there can be multiple answers.

In the third sample, applying f_7 = 1 makes f_{23333} = 1.

In the fourth sample, no such f_1 makes f_{88888} = 66666. Therefore, we output -1 instead.


You are given an undirected unweighted connected graph consisting of n vertices and m edges. It is guaranteed that there are no self-loops or multiple edges in the given graph.

Your task is to find any spanning tree of this graph such that the degree of the first vertex (vertex with label 1 on it) is equal to D (or say that there are no such spanning trees). Recall that the degree of a vertex is the number of edges incident to it.

Input

The first line contains three integers n, m and D (2 ≤ n ≤ 2 ⋅ 10^5, n - 1 ≤ m ≤ min(2 ⋅ 10^5, (n(n-1))/(2)), 1 ≤ D < n) — the number of vertices, the number of edges and required degree of the first vertex, respectively.

The following m lines denote edges: edge i is represented by a pair of integers v_i, u_i (1 ≤ v_i, u_i ≤ n, u_i ≠ v_i), which are the indices of vertices connected by the edge. There are no loops or multiple edges in the given graph, i. e. for each pair (v_i, u_i) there are no other pairs (v_i, u_i) or (u_i, v_i) in the list of edges, and for each pair (v_i, u_i) the condition v_i ≠ u_i is satisfied.

Output

If there is no spanning tree satisfying the condition from the problem statement, print "NO" in the first line.

Otherwise print "YES" in the first line and then print n-1 lines describing the edges of a spanning tree such that the degree of the first vertex (vertex with label 1 on it) is equal to D. Make sure that the edges of the printed spanning tree form some subset of the input edges (order doesn't matter and edge (v, u) is considered the same as the edge (u, v)).

If there are multiple possible answers, print any of them.

Examples

Input

4 5 1
1 2
1 3
1 4
2 3
3 4

Output

YES
2 1
2 3
3 4

Input

4 5 3
1 2
1 3
1 4
2 3
3 4

Output

YES
1 2
1 3
4 1

Input

4 4 3
1 2
1 4
2 3
3 4

Output

NO

Note

The picture corresponding to the first and second examples: <image>

The picture corresponding to the third example: <image>


There is a robot staying at X=0 on the Ox axis. He has to walk to X=n. You are controlling this robot and controlling how he goes. The robot has a battery and an accumulator with a solar panel.

The i-th segment of the path (from X=i-1 to X=i) can be exposed to sunlight or not. The array s denotes which segments are exposed to sunlight: if segment i is exposed, then s_i = 1, otherwise s_i = 0.

The robot has one battery of capacity b and one accumulator of capacity a. For each segment, you should choose which type of energy storage robot will use to go to the next point (it can be either battery or accumulator). If the robot goes using the battery, the current charge of the battery is decreased by one (the robot can't use the battery if its charge is zero). And if the robot goes using the accumulator, the current charge of the accumulator is decreased by one (and the robot also can't use the accumulator if its charge is zero).

If the current segment is exposed to sunlight and the robot goes through it using the battery, the charge of the accumulator increases by one (of course, its charge can't become higher than it's maximum capacity).

If accumulator is used to pass some segment, its charge decreases by 1 no matter if the segment is exposed or not.

You understand that it is not always possible to walk to X=n. You want your robot to go as far as possible. Find the maximum number of segments of distance the robot can pass if you control him optimally.

Input

The first line of the input contains three integers n, b, a (1 ≤ n, b, a ≤ 2 ⋅ 10^5) — the robot's destination point, the battery capacity and the accumulator capacity, respectively.

The second line of the input contains n integers s_1, s_2, ..., s_n (0 ≤ s_i ≤ 1), where s_i is 1 if the i-th segment of distance is exposed to sunlight, and 0 otherwise.

Output

Print one integer — the maximum number of segments the robot can pass if you control him optimally.

Examples

Input

5 2 1
0 1 0 1 0

Output

5

Input

6 2 1
1 0 0 1 0 1

Output

3

Note

In the first example the robot can go through the first segment using the accumulator, and charge levels become b=2 and a=0. The second segment can be passed using the battery, and charge levels become b=1 and a=1. The third segment can be passed using the accumulator, and charge levels become b=1 and a=0. The fourth segment can be passed using the battery, and charge levels become b=0 and a=1. And the fifth segment can be passed using the accumulator.

In the second example the robot can go through the maximum number of segments using battery two times and accumulator one time in any order.


You are given an array a consisting of n integers a_1, a_2, ... , a_n.

In one operation you can choose two elements of the array and replace them with the element equal to their sum (it does not matter where you insert the new element). For example, from the array [2, 1, 4] you can obtain the following arrays: [3, 4], [1, 6] and [2, 5].

Your task is to find the maximum possible number of elements divisible by 3 that are in the array after performing this operation an arbitrary (possibly, zero) number of times.

You have to answer t independent queries.

Input

The first line contains one integer t (1 ≤ t ≤ 1000) — the number of queries.

The first line of each query contains one integer n (1 ≤ n ≤ 100).

The second line of each query contains n integers a_1, a_2, ... , a_n (1 ≤ a_i ≤ 10^9).

Output

For each query print one integer in a single line — the maximum possible number of elements divisible by 3 that are in the array after performing described operation an arbitrary (possibly, zero) number of times.

Example

Input

2
5
3 1 2 3 1
7
1 1 1 1 1 2 2

Output

3
3

Note

In the first query of the example you can apply the following sequence of operations to obtain 3 elements divisible by 3: [3, 1, 2, 3, 1] → [3, 3, 3, 1].

In the second query you can obtain 3 elements divisible by 3 with the following sequence of operations: [1, 1, 1, 1, 1, 2, 2] → [1, 1, 1, 1, 2, 3] → [1, 1, 1, 3, 3] → [2, 1, 3, 3] → [3, 3, 3].


Old timers of Summer Informatics School can remember previous camps in which each student was given a drink of his choice on the vechorka (late-evening meal). Or may be the story was more complicated?

There are n students living in a building, and for each of them the favorite drink a_i is known. So you know n integers a_1, a_2, ..., a_n, where a_i (1 ≤ a_i ≤ k) is the type of the favorite drink of the i-th student. The drink types are numbered from 1 to k.

There are infinite number of drink sets. Each set consists of exactly two portions of the same drink. In other words, there are k types of drink sets, the j-th type contains two portions of the drink j. The available number of sets of each of the k types is infinite.

You know that students will receive the minimum possible number of sets to give all students exactly one drink. Obviously, the number of sets will be exactly ⌈ n/2 ⌉, where ⌈ x ⌉ is x rounded up.

After students receive the sets, they will distribute their portions by their choice: each student will get exactly one portion. Note, that if n is odd then one portion will remain unused and the students' teacher will drink it.

What is the maximum number of students that can get their favorite drink if ⌈ n/2 ⌉ sets will be chosen optimally and students will distribute portions between themselves optimally?

Input

The first line of the input contains two integers n and k (1 ≤ n, k ≤ 1 000) — the number of students in the building and the number of different drinks.

The next n lines contain student's favorite drinks. The i-th line contains a single integer from 1 to k — the type of the favorite drink of the i-th student.

Output

Print exactly one integer — the maximum number of students that can get a favorite drink.

Examples

Input

5 3
1
3
1
1
2

Output

4

Input

10 3
2
1
3
2
3
3
1
3
1
2

Output

9

Note

In the first example, students could choose three sets with drinks 1, 1 and 2 (so they will have two sets with two drinks of the type 1 each and one set with two drinks of the type 2, so portions will be 1, 1, 1, 1, 2, 2). This way all students except the second one will get their favorite drinks.

Another possible answer is sets with drinks 1, 2 and 3. In this case the portions will be 1, 1, 2, 2, 3, 3. Then all the students except one will gain their favorite drinks. The only student that will not gain the favorite drink will be a student with a_i = 1 (i.e. the first, the third or the fourth).


Polycarp recently became an employee of the company "Double Permutation Inc." Now he is a fan of permutations and is looking for them everywhere!

A permutation in this problem is a sequence of integers p_1, p_2, ..., p_k such that every integer from 1 to k occurs exactly once in it. For example, the following sequences are permutations of [3, 1, 4, 2], [1] and [6, 1, 2, 3, 5, 4]. The following sequences are not permutations: [0, 1], [1, 2, 2], [1, 2, 4] and [2, 3].

In the lobby of the company's headquarter statistics on visits to the company's website for the last n days are published — the sequence a_1, a_2, ..., a_n. Polycarp wants to color all the elements of this sequence in one of three colors (red, green or blue) so that:

  * all red numbers, being written out of a_1, a_2, ..., a_n from left to right (that is, without changing their relative order), must form some permutation (let's call it P);
  * all green numbers, being written out of a_1, a_2, ..., a_n from left to right (that is, without changing their relative order), must form the same permutation P;
  * among blue numbers there should not be elements that are equal to some element of the permutation P.

Help Polycarp to color all n numbers so that the total number of red and green elements is maximum.

Input

The first line contains an integer n (1 ≤ n ≤ 2⋅10^5) — the length of the sequence a. The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 2⋅10^5).

Output

Print a string s of length n such that:

  * s_i='R', if the element a_i must be colored in red;
  * s_i='G', if the element a_i must be colored in green;
  * s_i='B', if the element a_i must be colored in blue.

The string s should maximize the total number of red and green elements when fulfilling the requirements from the main part of the problem statement. If there are several optimal answers, print any of them.

Examples

Input

5
1 2 3 2 1

Output

RBBBG

Input

3
1 1 1

Output

BBB

Input

10
3 3 2 2 5 4 1 5 4 1

Output

RGRGRRRGGG

Input

10
3 9 3 1 2 1 2 4 4 4

Output

RBGRRGGBBB


You are given a system of pipes. It consists of two rows, each row consists of n pipes. The top left pipe has the coordinates (1, 1) and the bottom right — (2, n).

There are six types of pipes: two types of straight pipes and four types of curved pipes. Here are the examples of all six types:

<image> Types of pipes

You can turn each of the given pipes 90 degrees clockwise or counterclockwise arbitrary (possibly, zero) number of times (so the types 1 and 2 can become each other and types 3, 4, 5, 6 can become each other).

You want to turn some pipes in a way that the water flow can start at (1, 0) (to the left of the top left pipe), move to the pipe at (1, 1), flow somehow by connected pipes to the pipe at (2, n) and flow right to (2, n + 1).

Pipes are connected if they are adjacent in the system and their ends are connected. Here are examples of connected pipes:

<image> Examples of connected pipes

Let's describe the problem using some example:

<image> The first example input

And its solution is below:

<image> The first example answer

As you can see, the water flow is the poorly drawn blue line. To obtain the answer, we need to turn the pipe at (1, 2) 90 degrees clockwise, the pipe at (2, 3) 90 degrees, the pipe at (1, 6) 90 degrees, the pipe at (1, 7) 180 degrees and the pipe at (2, 7) 180 degrees. Then the flow of water can reach (2, n + 1) from (1, 0).

You have to answer q independent queries.

Input

The first line of the input contains one integer q (1 ≤ q ≤ 10^4) — the number of queries. Then q queries follow.

Each query consists of exactly three lines. The first line of the query contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of pipes in each row. The next two lines contain a description of the first and the second rows correspondingly. Each row description consists of n digits from 1 to 6 without any whitespaces between them, each digit corresponds to the type of pipe in the corresponding cell. See the problem statement to understand which digits correspond to which types of pipes.

It is guaranteed that the sum of n over all queries does not exceed 2 ⋅ 10^5.

Output

For the i-th query print the answer for it — "YES" (without quotes) if it is possible to turn some pipes in a way that the water flow can reach (2, n + 1) from (1, 0), and "NO" otherwise.

Example

Input

6
7
2323216
1615124
1
3
4
2
13
24
2
12
34
3
536
345
2
46
54

Output

YES
YES
YES
NO
YES
NO

Note

The first query from the example is described in the problem statement.


The Central Company has an office with a sophisticated security system. There are 10^6 employees, numbered from 1 to 10^6.

The security system logs entrances and departures. The entrance of the i-th employee is denoted by the integer i, while the departure of the i-th employee is denoted by the integer -i.

The company has some strict rules about access to its office:

  * An employee can enter the office at most once per day.
  * He obviously can't leave the office if he didn't enter it earlier that day.
  * In the beginning and at the end of every day, the office is empty (employees can't stay at night). It may also be empty at any moment of the day.

Any array of events satisfying these conditions is called a valid day.

Some examples of valid or invalid days:

  * [1, 7, -7, 3, -1, -3] is a valid day (1 enters, 7 enters, 7 leaves, 3 enters, 1 leaves, 3 leaves).
  * [2, -2, 3, -3] is also a valid day.
  * [2, 5, -5, 5, -5, -2] is not a valid day, because 5 entered the office twice during the same day.
  * [-4, 4] is not a valid day, because 4 left the office without being in it.
  * [4] is not a valid day, because 4 entered the office and didn't leave it before the end of the day.

There are n events a_1, a_2, …, a_n, in the order they occurred. This array corresponds to one or more consecutive days. The system administrator erased the dates of events by mistake, but he didn't change the order of the events.

You must partition (to cut) the array a of events into contiguous subarrays, which must represent non-empty valid days (or say that it's impossible). Each array element should belong to exactly one contiguous subarray of a partition. Each contiguous subarray of a partition should be a valid day.

For example, if n=8 and a=[1, -1, 1, 2, -1, -2, 3, -3] then he can partition it into two contiguous subarrays which are valid days: a = [1, -1~ \boldsymbol{|}~ 1, 2, -1, -2, 3, -3].

Help the administrator to partition the given array a in the required way or report that it is impossible to do. Find any required partition, you should not minimize or maximize the number of parts.

Input

The first line contains a single integer n (1 ≤ n ≤ 10^5).

The second line contains n integers a_1, a_2, …, a_n (-10^6 ≤ a_i ≤ 10^6 and a_i ≠ 0).

Output

If there is no valid partition, print -1. Otherwise, print any valid partition in the following format:

  * On the first line print the number d of days (1 ≤ d ≤ n).
  * On the second line, print d integers c_1, c_2, …, c_d (1 ≤ c_i ≤ n and c_1 + c_2 + … + c_d = n), where c_i is the number of events in the i-th day.

If there are many valid solutions, you can print any of them. You don't have to minimize nor maximize the number of days.

Examples

Input

6
1 7 -7 3 -1 -3

Output

1
6

Input

8
1 -1 1 2 -1 -2 3 -3

Output

2
2 6

Input

6
2 5 -5 5 -5 -2

Output

-1

Input

3
-8 1 1

Output

-1

Note

In the first example, the whole array is a valid day.

In the second example, one possible valid solution is to split the array into [1, -1] and [1, 2, -1, -2, 3, -3] (d = 2 and c = [2, 6]). The only other valid solution would be to split the array into [1, -1], [1, 2, -1, -2] and [3, -3] (d = 3 and c = [2, 4, 2]). Both solutions are accepted.

In the third and fourth examples, we can prove that there exists no valid solution. Please note that the array given in input is not guaranteed to represent a coherent set of events.


Hooray! Polycarp turned n years old! The Technocup Team sincerely congratulates Polycarp!

Polycarp celebrated all of his n birthdays: from the 1-th to the n-th. At the moment, he is wondering: how many times he turned beautiful number of years?

According to Polycarp, a positive integer is beautiful if it consists of only one digit repeated one or more times. For example, the following numbers are beautiful: 1, 77, 777, 44 and 999999. The following numbers are not beautiful: 12, 11110, 6969 and 987654321.

Of course, Polycarpus uses the decimal numeral system (i.e. radix is 10).

Help Polycarpus to find the number of numbers from 1 to n (inclusive) that are beautiful.

Input

The first line contains an integer t (1 ≤ t ≤ 10^4) — the number of test cases in the input. Then t test cases follow.

Each test case consists of one line, which contains a positive integer n (1 ≤ n ≤ 10^9) — how many years Polycarp has turned.

Output

Print t integers — the answers to the given test cases in the order they are written in the test. Each answer is an integer: the number of beautiful years between 1 and n, inclusive.

Example

Input

6
18
1
9
100500
33
1000000000

Output

10
1
9
45
12
81

Note

In the first test case of the example beautiful years are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 11.


Polycarp is working on the implementation of displaying likes on the Codehorses social network. The number of likes should be displayed in a format that will be easy to read by users. It was decided that for large numbers of likes the format should be like 123K (one hundred twenty-three thousand) or like 56M (fifty-six million).

The following displaying strategy has been approved:

  * the number will be displayed either as an integer number from 0 to 999, or as a positive integer number of thousands (from 1K to 999K), or as a positive integer number of millions (from 1M on),
  * the specified exact number of likes n when displaying should be rounded to the nearest view from the case above (if rounding is ambiguous, it must be rounded up): for example, 1785 should be rounded to 2K instead of 1K, 4500000 should be rounded to 5M.

Help Polycarp implement this part of the functionality: for a given non-negative integer number of likes n, print its view in the Codehorses interface.

Input

The first line contains an integer t (1 ≤ t ≤ 1000) — the number of test cases in the input. The following are descriptions of the t input test cases, one per line.

The description of each test case consists of a single line that contains a non-negative integer n (0 ≤ n ≤ 2⋅10^9) — the number of likes.

Output

Print t answers to the given test cases in the order from the input. Each printed value must have one of the following types:

  * either an integer from 0 to 999 which corresponds just to the number of likes,
  * or a number of thousands from 1K to 999K,
  * or a number of millions from 1M to 2000M.

The answer is equal to a view which is the closest (by difference) to the given number n. If this rounding is ambiguous, then round answer up (to a greater value).

Example

Input

9
999
123
0
1782
31415926
1500
999999
35499710
2000000000

Output

999
123
0
2K
31M
2K
1M
35M
2000M

Note

Let's describe some test cases:

  * 1782 can be displayed either as 1K or as 2K but 2K is the nearest view;
  * 1500 have same difference with 1K and 2K so it should be rounded up;
  * 999999 should be displayed as 1M since it's closer to it than to 999K.


The map of Bertown can be represented as a set of n intersections, numbered from 1 to n and connected by m one-way roads. It is possible to move along the roads from any intersection to any other intersection. The length of some path from one intersection to another is the number of roads that one has to traverse along the path. The shortest path from one intersection v to another intersection u is the path that starts in v, ends in u and has the minimum length among all such paths.

Polycarp lives near the intersection s and works in a building near the intersection t. Every day he gets from s to t by car. Today he has chosen the following path to his workplace: p_1, p_2, ..., p_k, where p_1 = s, p_k = t, and all other elements of this sequence are the intermediate intersections, listed in the order Polycarp arrived at them. Polycarp never arrived at the same intersection twice, so all elements of this sequence are pairwise distinct. Note that you know Polycarp's path beforehand (it is fixed), and it is not necessarily one of the shortest paths from s to t.

Polycarp's car has a complex navigation system installed in it. Let's describe how it works. When Polycarp starts his journey at the intersection s, the system chooses some shortest path from s to t and shows it to Polycarp. Let's denote the next intersection in the chosen path as v. If Polycarp chooses to drive along the road from s to v, then the navigator shows him the same shortest path (obviously, starting from v as soon as he arrives at this intersection). However, if Polycarp chooses to drive to another intersection w instead, the navigator rebuilds the path: as soon as Polycarp arrives at w, the navigation system chooses some shortest path from w to t and shows it to Polycarp. The same process continues until Polycarp arrives at t: if Polycarp moves along the road recommended by the system, it maintains the shortest path it has already built; but if Polycarp chooses some other path, the system rebuilds the path by the same rules.

Here is an example. Suppose the map of Bertown looks as follows, and Polycarp drives along the path [1, 2, 3, 4] (s = 1, t = 4):

Check the picture by the link [http://tk.codeforces.com/a.png](//tk.codeforces.com/a.png)

  1. When Polycarp starts at 1, the system chooses some shortest path from 1 to 4. There is only one such path, it is [1, 5, 4];
  2. Polycarp chooses to drive to 2, which is not along the path chosen by the system. When Polycarp arrives at 2, the navigator rebuilds the path by choosing some shortest path from 2 to 4, for example, [2, 6, 4] (note that it could choose [2, 3, 4]);
  3. Polycarp chooses to drive to 3, which is not along the path chosen by the system. When Polycarp arrives at 3, the navigator rebuilds the path by choosing the only shortest path from 3 to 4, which is [3, 4];
  4. Polycarp arrives at 4 along the road chosen by the navigator, so the system does not have to rebuild anything.

Overall, we get 2 rebuilds in this scenario. Note that if the system chose [2, 3, 4] instead of [2, 6, 4] during the second step, there would be only 1 rebuild (since Polycarp goes along the path, so the system maintains the path [3, 4] during the third step).

The example shows us that the number of rebuilds can differ even if the map of Bertown and the path chosen by Polycarp stays the same. Given this information (the map and Polycarp's path), can you determine the minimum and the maximum number of rebuilds that could have happened during the journey?

Input

The first line contains two integers n and m (2 ≤ n ≤ m ≤ 2 ⋅ 10^5) — the number of intersections and one-way roads in Bertown, respectively.

Then m lines follow, each describing a road. Each line contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v) denoting a road from intersection u to intersection v. All roads in Bertown are pairwise distinct, which means that each ordered pair (u, v) appears at most once in these m lines (but if there is a road (u, v), the road (v, u) can also appear).

The following line contains one integer k (2 ≤ k ≤ n) — the number of intersections in Polycarp's path from home to his workplace.

The last line contains k integers p_1, p_2, ..., p_k (1 ≤ p_i ≤ n, all these integers are pairwise distinct) — the intersections along Polycarp's path in the order he arrived at them. p_1 is the intersection where Polycarp lives (s = p_1), and p_k is the intersection where Polycarp's workplace is situated (t = p_k). It is guaranteed that for every i ∈ [1, k - 1] the road from p_i to p_{i + 1} exists, so the path goes along the roads of Bertown.

Output

Print two integers: the minimum and the maximum number of rebuilds that could have happened during the journey.

Examples

Input

6 9
1 5
5 4
1 2
2 3
3 4
4 1
2 6
6 4
4 2
4
1 2 3 4

Output

1 2

Input

7 7
1 2
2 3
3 4
4 5
5 6
6 7
7 1
7
1 2 3 4 5 6 7

Output

0 0

Input

8 13
8 7
8 6
7 5
7 4
6 5
6 4
5 3
5 2
4 3
4 2
3 1
2 1
1 8
5
8 7 5 2 1

Output

0 3


Consider the infinite sequence s of positive integers, created by repeating the following steps:

  1. Find the lexicographically smallest triple of positive integers (a, b, c) such that
    * a ⊕ b ⊕ c = 0, where ⊕ denotes the [bitwise XOR operation](https://en.wikipedia.org/wiki/Bitwise_operation#XOR).
    * a, b, c are not in s.
Here triple of integers (a_1, b_1, c_1) is considered to be lexicographically smaller than triple (a_2, b_2, c_2) if sequence [a_1, b_1, c_1] is lexicographically smaller than sequence [a_2, b_2, c_2].
  2. Append a, b, c to s in this order.
  3. Go back to the first step.

You have integer n. Find the n-th element of s.

You have to answer t independent test cases.

A sequence a is lexicographically smaller than a sequence b if in the first position where a and b differ, the sequence a has a smaller element than the corresponding element in b.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^5) — the number of test cases.

Each of the next t lines contains a single integer n (1≤ n ≤ 10^{16}) — the position of the element you want to know.

Output

In each of the t lines, output the answer to the corresponding test case.

Example

Input

9
1
2
3
4
5
6
7
8
9

Output

1
2
3
4
8
12
5
10
15

Note

The first elements of s are 1, 2, 3, 4, 8, 12, 5, 10, 15, ...


Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connected by a reference has to cover different topics because otherwise, the readers can notice that they are split just for more contribution. Set of blogs and bidirectional references between some pairs of them is called blogs network.

There are n different topics, numbered from 1 to n sorted by Johnny's knowledge. The structure of the blogs network is already prepared. Now Johnny has to write the blogs in some order. He is lazy, so each time before writing a blog, he looks at it's already written neighbors (the blogs referenced to current one) and chooses the topic with the smallest number which is not covered by neighbors. It's easy to see that this strategy will always allow him to choose a topic because there are at most n - 1 neighbors.

For example, if already written neighbors of the current blog have topics number 1, 3, 1, 5, and 2, Johnny will choose the topic number 4 for the current blog, because topics number 1, 2 and 3 are already covered by neighbors and topic number 4 isn't covered.

As a good friend, you have done some research and predicted the best topic for each blog. Can you tell Johnny, in which order he has to write the blogs, so that his strategy produces the topic assignment chosen by you?

Input

The first line contains two integers n (1 ≤ n ≤ 5 ⋅ 10^5) and m (0 ≤ m ≤ 5 ⋅ 10^5) — the number of blogs and references, respectively.

Each of the following m lines contains two integers a and b (a ≠ b; 1 ≤ a, b ≤ n), which mean that there is a reference between blogs a and b. It's guaranteed that the graph doesn't contain multiple edges.

The last line contains n integers t_1, t_2, …, t_n, i-th of them denotes desired topic number of the i-th blog (1 ≤ t_i ≤ n).

Output

If the solution does not exist, then write -1. Otherwise, output n distinct integers p_1, p_2, …, p_n (1 ≤ p_i ≤ n), which describe the numbers of blogs in order which Johnny should write them. If there are multiple answers, print any.

Examples

Input

3 3
1 2
2 3
3 1
2 1 3

Output

2 1 3

Input

3 3
1 2
2 3
3 1
1 1 1

Output

-1

Input

5 3
1 2
2 3
4 5
2 1 2 2 1

Output

2 5 1 3 4

Note

In the first example, Johnny starts with writing blog number 2, there are no already written neighbors yet, so it receives the first topic. Later he writes blog number 1, it has reference to the already written second blog, so it receives the second topic. In the end, he writes blog number 3, it has references to blogs number 1 and 2 so it receives the third topic.

Second example: There does not exist any permutation fulfilling given conditions.

Third example: First Johnny writes blog 2, it receives the topic 1. Then he writes blog 5, it receives the topic 1 too because it doesn't have reference to single already written blog 2. Then he writes blog number 1, it has reference to blog number 2 with topic 1, so it receives the topic 2. Then he writes blog number 3 which has reference to blog 2, so it receives the topic 2. Then he ends with writing blog number 4 which has reference to blog 5 and receives the topic 2.


Let a and b be two arrays of lengths n and m, respectively, with no elements in common. We can define a new array merge(a,b) of length n+m recursively as follows:

  * If one of the arrays is empty, the result is the other array. That is, merge(∅,b)=b and merge(a,∅)=a. In particular, merge(∅,∅)=∅.
  * If both arrays are non-empty, and a_1<b_1, then merge(a,b)=[a_1]+merge([a_2,…,a_n],b). That is, we delete the first element a_1 of a, merge the remaining arrays, then add a_1 to the beginning of the result.
  * If both arrays are non-empty, and a_1>b_1, then merge(a,b)=[b_1]+merge(a,[b_2,…,b_m]). That is, we delete the first element b_1 of b, merge the remaining arrays, then add b_1 to the beginning of the result.

This algorithm has the nice property that if a and b are sorted, then merge(a,b) will also be sorted. For example, it is used as a subroutine in merge-sort. For this problem, however, we will consider the same procedure acting on non-sorted arrays as well. For example, if a=[3,1] and b=[2,4], then merge(a,b)=[2,3,1,4].

A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array) and [1,3,4] is also not a permutation (n=3 but there is 4 in the array).

There is a permutation p of length 2n. Determine if there exist two arrays a and b, each of length n and with no elements in common, so that p=merge(a,b).

Input

The first line contains a single integer t (1≤ t≤ 1000) — the number of test cases. Next 2t lines contain descriptions of test cases.

The first line of each test case contains a single integer n (1≤ n≤ 2000).

The second line of each test case contains 2n integers p_1,…,p_{2n} (1≤ p_i≤ 2n). It is guaranteed that p is a permutation.

It is guaranteed that the sum of n across all test cases does not exceed 2000.

Output

For each test case, output "YES" if there exist arrays a, b, each of length n and with no common elements, so that p=merge(a,b). Otherwise, output "NO".

Example

Input

6
2
2 3 1 4
2
3 1 2 4
4
3 2 6 1 5 7 8 4
3
1 2 3 4 5 6
4
6 1 3 7 4 5 8 2
6
4 3 2 5 1 11 9 12 8 6 10 7

Output

YES
NO
YES
YES
NO
NO

Note

In the first test case, [2,3,1,4]=merge([3,1],[2,4]).

In the second test case, we can show that [3,1,2,4] is not the merge of two arrays of length 2.

In the third test case, [3,2,6,1,5,7,8,4]=merge([3,2,8,4],[6,1,5,7]).

In the fourth test case, [1,2,3,4,5,6]=merge([1,3,6],[2,4,5]), for example.


You are given an array a_1, a_2, ..., a_n where all a_i are integers and greater than 0.

In one operation, you can choose two different indices i and j (1 ≤ i, j ≤ n). If gcd(a_i, a_j) is equal to the minimum element of the whole array a, you can swap a_i and a_j. gcd(x, y) denotes the [greatest common divisor (GCD)](https://en.wikipedia.org/wiki/Greatest_common_divisor) of integers x and y.

Now you'd like to make a non-decreasing using the operation any number of times (possibly zero). Determine if you can do this.

An array a is non-decreasing if and only if a_1 ≤ a_2 ≤ … ≤ a_n.

Input

The first line contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases.

The first line of each test case contains one integer n (1 ≤ n ≤ 10^5) — the length of array a.

The second line of each test case contains n positive integers a_1, a_2, … a_n (1 ≤ a_i ≤ 10^9) — the array itself.

It is guaranteed that the sum of n over all test cases doesn't exceed 10^5.

Output

For each test case, output "YES" if it is possible to make the array a non-decreasing using the described operation, or "NO" if it is impossible to do so.

Example

Input

4
1
8
6
4 3 6 6 2 9
4
4 5 6 7
5
7 5 2 2 4

Output

YES
YES
YES
NO

Note

In the first and third sample, the array is already non-decreasing.

In the second sample, we can swap a_1 and a_3 first, and swap a_1 and a_5 second to make the array non-decreasing.

In the forth sample, we cannot the array non-decreasing using the operation.


In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks.

More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a triangle.

Three numbers a, b and c can form sides of a triangle if a + b > c, b + c > a and c + a > b.

In a group of numbers, a number is lonely if it doesn't have any friends in that group.

Given a group of numbers containing all numbers from 1, 2, 3, ..., n, how many numbers in that group are lonely?

Input

The first line contains a single integer t (1 ≤ t ≤ 10^6) - number of test cases.

On next line there are t numbers, n_i (1 ≤ n_i ≤ 10^6) - meaning that in case i you should solve for numbers 1, 2, 3, ..., n_i.

Output

For each test case, print the answer on separate lines: number of lonely numbers in group 1, 2, 3, ..., n_i.

Example

Input

3
1 5 10

Output

1
3
3

Note

For first test case, 1 is the only number and therefore lonely.

For second test case where n=5, numbers 1, 3 and 5 are lonely.

For third test case where n=10, numbers 1, 5 and 7 are lonely.


You have a knapsack with the capacity of W. There are also n items, the i-th one has weight w_i.

You want to put some of these items into the knapsack in such a way that their total weight C is at least half of its size, but (obviously) does not exceed it. Formally, C should satisfy: ⌈ W/2⌉ ≤ C ≤ W.

Output the list of items you will put into the knapsack or determine that fulfilling the conditions is impossible.

If there are several possible lists of items satisfying the conditions, you can output any. Note that you don't have to maximize the sum of weights of items in the knapsack.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10^4). Description of the test cases follows.

The first line of each test case contains integers n and W (1 ≤ n ≤ 200 000, 1≤ W ≤ 10^{18}).

The second line of each test case contains n integers w_1, w_2, ..., w_n (1 ≤ w_i ≤ 10^9) — weights of the items.

The sum of n over all test cases does not exceed 200 000.

Output

For each test case, if there is no solution, print a single integer -1.

If there exists a solution consisting of m items, print m in the first line of the output and m integers j_1, j_2, ..., j_m (1 ≤ j_i ≤ n, all j_i are distinct) in the second line of the output — indices of the items you would like to pack into the knapsack.

If there are several possible lists of items satisfying the conditions, you can output any. Note that you don't have to maximize the sum of weights items in the knapsack.

Example

Input

3
1 3
3
6 2
19 8 19 69 9 4
7 12
1 1 1 17 1 1 1

Output

1
1
-1
6
1 2 3 5 6 7

Note

In the first test case, you can take the item of weight 3 and fill the knapsack just right.

In the second test case, all the items are larger than the knapsack's capacity. Therefore, the answer is -1.

In the third test case, you fill the knapsack exactly in half.


Petya organized a strange birthday party. He invited n friends and assigned an integer k_i to the i-th of them. Now Petya would like to give a present to each of them. In the nearby shop there are m unique presents available, the j-th present costs c_j dollars (1 ≤ c_1 ≤ c_2 ≤ … ≤ c_m). It's not allowed to buy a single present more than once.

For the i-th friend Petya can either buy them a present j ≤ k_i, which costs c_j dollars, or just give them c_{k_i} dollars directly.

Help Petya determine the minimum total cost of hosting his party.

Input

The first input line contains a single integer t (1 ≤ t ≤ 10^3) — the number of test cases.

The first line of each test case contains two integers n and m (1 ≤ n, m ≤ 3 ⋅ 10^5) — the number of friends, and the number of unique presents available.

The following line contains n integers k_1, k_2, …, k_n (1 ≤ k_i ≤ m), assigned by Petya to his friends.

The next line contains m integers c_1, c_2, …, c_m (1 ≤ c_1 ≤ c_2 ≤ … ≤ c_m ≤ 10^9) — the prices of the presents.

It is guaranteed that sum of values n over all test cases does not exceed 3 ⋅ 10^5, and the sum of values m over all test cases does not exceed 3 ⋅ 10^5.

Output

For each test case output a single integer — the minimum cost of the party.

Examples

Input

2
5 4
2 3 4 3 2
3 5 12 20
5 5
5 4 3 2 1
10 40 90 160 250

Output

30
190

Input

1
1 1
1
1

Output

1

Note

In the first example, there are two test cases. In the first one, Petya has 5 friends and 4 available presents. Petya can spend only 30 dollars if he gives

  * 5 dollars to the first friend.
  * A present that costs 12 dollars to the second friend.
  * A present that costs 5 dollars to the third friend.
  * A present that costs 3 dollars to the fourth friend.
  * 5 dollars to the fifth friend.

In the second one, Petya has 5 and 5 available presents. Petya can spend only 190 dollars if he gives

  * A present that costs 10 dollars to the first friend.
  * A present that costs 40 dollars to the second friend.
  * 90 dollars to the third friend.
  * 40 dollars to the fourth friend.
  * 10 dollars to the fifth friend.


You are given a multiset S initially consisting of n distinct non-negative integers. A multiset is a set, that can contain some elements multiple times.

You will perform the following operation k times:

  * Add the element ⌈(a+b)/(2)⌉ (rounded up) into S, where a = \operatorname{mex}(S) and b = max(S). If this number is already in the set, it is added again.

Here \operatorname{max} of a multiset denotes the maximum integer in the multiset, and \operatorname{mex} of a multiset denotes the smallest non-negative integer that is not present in the multiset. For example:

  * \operatorname{mex}(\{1,4,0,2\})=3;
  * \operatorname{mex}(\{2,5,1\})=0.

Your task is to calculate the number of distinct elements in S after k operations will be done.

Input

The input consists of multiple test cases. The first line contains a single integer t (1≤ t≤ 100) — the number of test cases. The description of the test cases follows.

The first line of each test case contains two integers n, k (1≤ n≤ 10^5, 0≤ k≤ 10^9) — the initial size of the multiset S and how many operations you need to perform.

The second line of each test case contains n distinct integers a_1,a_2,...,a_n (0≤ a_i≤ 10^9) — the numbers in the initial multiset.

It is guaranteed that the sum of n over all test cases does not exceed 10^5.

Output

For each test case, print the number of distinct elements in S after k operations will be done.

Example

Input

5
4 1
0 1 3 4
3 1
0 1 4
3 0
0 1 4
3 2
0 1 2
3 2
1 2 3

Output

4
4
3
5
3

Note

In the first test case, S=\{0,1,3,4\}, a=\operatorname{mex}(S)=2, b=max(S)=4, ⌈(a+b)/(2)⌉=3. So 3 is added into S, and S becomes \{0,1,3,3,4\}. The answer is 4.

In the second test case, S=\{0,1,4\}, a=\operatorname{mex}(S)=2, b=max(S)=4, ⌈(a+b)/(2)⌉=3. So 3 is added into S, and S becomes \{0,1,3,4\}. The answer is 4.


There are n points on an infinite plane. The i-th point has coordinates (x_i, y_i) such that x_i > 0 and y_i > 0. The coordinates are not necessarily integer.

In one move you perform the following operations:

  * choose two points a and b (a ≠ b);
  * move point a from (x_a, y_a) to either (x_a + 1, y_a) or (x_a, y_a + 1);
  * move point b from (x_b, y_b) to either (x_b + 1, y_b) or (x_b, y_b + 1);
  * remove points a and b.

However, the move can only be performed if there exists a line that passes through the new coordinates of a, new coordinates of b and (0, 0).

Otherwise, the move can't be performed and the points stay at their original coordinates (x_a, y_a) and (x_b, y_b), respectively.

The numeration of points does not change after some points are removed. Once the points are removed, they can't be chosen in any later moves. Note that you have to move both points during the move, you can't leave them at their original coordinates.

What is the maximum number of moves you can perform? What are these moves?

If there are multiple answers, you can print any of them.

Input

The first line contains a single integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of points.

The i-th of the next n lines contains four integers a_i, b_i, c_i, d_i (1 ≤ a_i, b_i, c_i, d_i ≤ 10^9). The coordinates of the i-th point are x_i = (a_i)/(b_i) and y_i = (c_i)/(d_i).

Output

In the first line print a single integer c — the maximum number of moves you can perform.

Each of the next c lines should contain a description of a move: two integers a and b (1 ≤ a, b ≤ n, a ≠ b) — the points that are removed during the current move. There should be a way to move points a and b according to the statement so that there's a line that passes through the new coordinates of a, the new coordinates of b and (0, 0). No removed point can be chosen in a later move.

If there are multiple answers, you can print any of them. You can print the moves and the points in the move in the arbitrary order.

Examples

Input

7
4 1 5 1
1 1 1 1
3 3 3 3
1 1 4 1
6 1 1 1
5 1 4 1
6 1 1 1

Output

3
1 6
2 4
5 7

Input

4
2 1 1 1
1 1 2 1
2 1 1 2
1 2 1 2

Output

1
1 2

Input

4
182 168 60 96
78 72 45 72
69 21 144 63
148 12 105 6

Output

1
2 4

Note

Here are the points and the moves for the ones that get chosen for the moves from the first example:

<image>


Cirno has prepared n arrays of length n each. Each array is a permutation of n integers from 1 to n. These arrays are special: for all 1 ≤ i ≤ n, if we take the i-th element of each array and form another array of length n with these elements, the resultant array is also a permutation of n integers from 1 to n. In the other words, if you put these n arrays under each other to form a matrix with n rows and n columns, this matrix is a [Latin square](https://en.wikipedia.org/wiki/Latin_square).

Afterwards, Cirno added additional n arrays, each array is a permutation of n integers from 1 to n. For all 1 ≤ i ≤ n, there exists at least one position 1 ≤ k ≤ n, such that for the i-th array and the (n + i)-th array, the k-th element of both arrays is the same. Notice that the arrays indexed from n + 1 to 2n don't have to form a Latin square.

Also, Cirno made sure that for all 2n arrays, no two arrays are completely equal, i. e. for all pair of indices 1 ≤ i < j ≤ 2n, there exists at least one position 1 ≤ k ≤ n, such that the k-th elements of the i-th and j-th array are different.

Finally, Cirno arbitrarily changed the order of 2n arrays.

AquaMoon calls a subset of all 2n arrays of size n good if these arrays from a Latin square.

AquaMoon wants to know how many good subsets exist. Because this number may be particularly large, find it modulo 998 244 353. Also, she wants to find any good subset. Can you help her?

Input

The input consists of multiple test cases. The first line contains a single integer t (1 ≤ t ≤ 100) — the number of test cases.

The first line of each test case contains a single integer n (5 ≤ n ≤ 500).

Then 2n lines followed. The i-th of these lines contains n integers, representing the i-th array.

It is guaranteed, that the sum of n over all test cases does not exceed 500.

Output

For each test case print two lines.

In the first line, print the number of good subsets by modulo 998 244 353.

In the second line, print n indices from 1 to 2n — indices of the n arrays that form a good subset (you can print them in any order). If there are several possible answers — print any of them.

Example

Input

3
7
1 2 3 4 5 6 7
2 3 4 5 6 7 1
3 4 5 6 7 1 2
4 5 6 7 1 2 3
5 6 7 1 2 3 4
6 7 1 2 3 4 5
7 1 2 3 4 5 6
1 2 3 4 5 7 6
1 3 4 5 6 7 2
1 4 5 6 7 3 2
1 5 6 7 4 2 3
1 6 7 5 2 3 4
1 7 6 2 3 4 5
1 7 2 3 4 5 6
5
4 5 1 2 3
3 5 2 4 1
1 2 3 4 5
5 2 4 1 3
3 4 5 1 2
2 3 4 5 1
1 3 5 2 4
4 1 3 5 2
2 4 1 3 5
5 1 2 3 4
6
2 3 4 5 6 1
3 1 2 6 4 5
6 1 2 3 4 5
5 6 1 3 2 4
4 3 6 5 2 1
5 6 1 2 3 4
4 5 6 1 2 3
3 4 5 6 1 2
1 2 3 4 5 6
2 5 4 1 6 3
3 2 5 4 1 6
1 4 3 6 5 2

Output

1
1 2 3 4 5 6 7
2
1 3 5 6 10
4
1 3 6 7 8 9

Note

In the first test case, the number of good subsets is 1. The only such subset is the set of arrays with indices 1, 2, 3, 4, 5, 6, 7.

In the second test case, the number of good subsets is 2. They are 1, 3, 5, 6, 10 or 2, 4, 7, 8, 9.


A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.

Polycarpus has already began the process and he partially emptied the Ber-Cola bottle. Now the first mug has a1 milliliters of the drink, the second one has a2 milliliters and so on. The bottle has b milliliters left and Polycarpus plans to pour them into the mugs so that the main equation was fulfilled.

Write a program that would determine what volume of the drink Polycarpus needs to add into each mug to ensure that the following two conditions were fulfilled simultaneously:

  * there were b milliliters poured in total. That is, the bottle need to be emptied;
  * after the process is over, the volumes of the drink in the mugs should be equal.

Input

The first line contains a pair of integers n, b (2 ≤ n ≤ 100, 1 ≤ b ≤ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≤ ai ≤ 100), where ai is the current volume of drink in the i-th mug.

Output

Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a solution exists then it is unique.

Russian locale is installed by default on the testing computer. Make sure that your solution use the point to separate the integer part of a real number from the decimal, not a comma.

Examples

Input

5 50
1 2 3 4 5

Output

12.000000
11.000000
10.000000
9.000000
8.000000

Input

2 2
1 100

Output

-1


There is a square painted on a piece of paper, the square's side equals n meters. John Doe draws crosses on the square's perimeter. John paints the first cross in the lower left corner of the square. Then John moves along the square's perimeter in the clockwise direction (first upwards, then to the right, then downwards, then to the left and so on). Every time he walks (n + 1) meters, he draws a cross (see picture for clarifications).

John Doe stops only when the lower left corner of the square has two crosses. How many crosses will John draw?

<image> The figure shows the order in which John draws crosses for a square with side 4. The lower left square has two crosses. Overall John paints 17 crosses.

Input

The first line contains integer t (1 ≤ t ≤ 104) — the number of test cases.

The second line contains t space-separated integers ni (1 ≤ ni ≤ 109) — the sides of the square for each test sample.

Output

For each test sample print on a single line the answer to it, that is, the number of crosses John will draw as he will move along the square of the corresponding size. Print the answers to the samples in the order in which the samples are given in the input.

Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples

Input

3
4 8 100

Output

17
33
401