This is an interactive problem.

In good old times dwarves tried to develop extrasensory abilities:

  * Exactly n dwarves entered completely dark cave.
  * Each dwarf received a hat — white or black. While in cave, none of the dwarves was able to see either his own hat or hats of other Dwarves.
  * Dwarves went out of the cave to the meadow and sat at an arbitrary place one after the other. When a dwarf leaves the cave, he sees the colors of all hats of all dwarves that are seating on the meadow (i.e. left the cave before him). However, he is not able to see the color of his own hat and none of the dwarves can give him this information.
  * The task for dwarves was to got diverged into two parts — one with dwarves with white hats and one with black hats.

After many centuries, dwarves finally managed to select the right place on the meadow without error. Will you be able to repeat their success?

You are asked to successively name n different integer points on the plane. After naming each new point you will be given its color — black or white. Your task is to ensure that the named points can be split by a line in such a way that all points of one color lie on the same side from the line and points of different colors lie on different sides. Moreover, no points can belong to the line. Also, you need to report any such line at the end of the process.

In this problem, the interactor is adaptive — the colors of the points in the tests are not fixed beforehand and the jury program can select them arbitrarily, in particular, depending on your program output.

Interaction

The first line of the standard input stream contains an integer n (1 ≤ n ≤ 30) — the number of points your program should name.

Then n times your program must print two integer coordinates x and y (0 ≤ x ≤ 109, 0 ≤ y ≤ 109). All points you print must be distinct.

In response to each coordinate pair your program will receive the string "black", if the point is black, or "white", if the point is white.

When all n points are processed, you need to print four integers x1, y1, x2 and y2 (0 ≤ x1, y1 ≤ 109, 0 ≤ x2, y2 ≤ 109) — coordinates of points (x1, y1) and (x2, y2), which form a line, which separates n points into black and white. Points (x1, y1) and (x2, y2) should not coincide.

Hacks

To hack solution use the following format. The first line must contain word "hack", the second line should contain the number n and the last line should contain the sequence of 0 and 1 — colors of points, which will be reported to the solution. Unlike the jury tests, colors of points in hacks are always fixed in advance. Of course, the hacked solution wouldn't be able to get the information about the colors in advance.

For example, the hack corresponding to sample test will look like this:

    hack
    5
    0 0 1 1 0

Example

Input

5

black

black

white

white

black

Output

0 0

3 1

2 3

4 4

0 2

1 3 4 1

Note

In the sample input and output values are aligned only for simplicity of interpreting them chronologically. In real interaction no "extra" line breaks should appear.

The following picture illustrates the first test.

<image>


Vasya owns three strings s , a and b, each of them consists only of first k Latin letters.

Let a template be such a string of length k that each of the first k Latin letters appears in it exactly once (thus there are k! distinct templates). Application of template p to the string s is the replacement of each character in string s with p_i, i is the index of this letter in the alphabet. For example, applying template "bdca" to a string "aabccd" yields string "bbdcca".

Vasya wants to know if there exists such a template which yields a string lexicographically greater than or equal to string a and lexicographically less than or equal to string b after applying it to s.

If there exist multiple suitable templates, print any of them.

String a is lexicographically less than string b if there is some i (1 ≤ i ≤ n) that a_i < b_i and for any j (1 ≤ j < i) a_j = b_j.

You are required to answer t testcases independently.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^6) — the number of testcases.

In hacks you can only use t = 1.

Each of the next t lines contains the description of the testcase in the following form:

The first line of the testcase contains a single integer k (1 ≤ k ≤ 26) — the length of the template.

The second line of the testcase contains the string s (1 ≤ |s| ≤ 10^6).

The third line of the testcase contains the string a.

The fourth line of the testcase contains the string b.

Strings s, a and b have the same length (|s| = |a| = |b|) and consist only of the first k Latin letters, all letters are lowercase.

It is guaranteed that string a is lexicographically less than or equal to string b.

It is also guaranteed that the total length of strings over all testcase won't exceed 3 ⋅ 10^6.

Output

Print the answers to all testcases in the following form:

If there exists no suitable template then print "NO" in the first line.

Otherwise print "YES" in the first line and the template itself in the second line (k lowercase letters, each of the first k Latin letters should appear exactly once).

If there exist multiple suitable templates, print any of them.

Example

Input

2
4
bbcb
aada
aada
3
abc
bbb
bbb

Output

YES
badc
NO


Lunar New Year is approaching, and Bob is struggling with his homework – a number division problem.

There are n positive integers a_1, a_2, …, a_n on Bob's homework paper, where n is always an even number. Bob is asked to divide those numbers into groups, where each group must contain at least 2 numbers. Suppose the numbers are divided into m groups, and the sum of the numbers in the j-th group is s_j. Bob's aim is to minimize the sum of the square of s_j, that is $$$∑_{j = 1}^{m} s_j^2.$$$

Bob is puzzled by this hard problem. Could you please help him solve it?

Input

The first line contains an even integer n (2 ≤ n ≤ 3 ⋅ 10^5), denoting that there are n integers on Bob's homework paper.

The second line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^4), describing the numbers you need to deal with.

Output

A single line containing one integer, denoting the minimum of the sum of the square of s_j, which is $$$∑_{i = j}^{m} s_j^2, where m$$$ is the number of groups.

Examples

Input

4
8 5 2 3

Output

164

Input

6
1 1 1 2 2 2

Output

27

Note

In the first sample, one of the optimal solutions is to divide those 4 numbers into 2 groups \{2, 8\}, \{5, 3\}. Thus the answer is (2 + 8)^2 + (5 + 3)^2 = 164.

In the second sample, one of the optimal solutions is to divide those 6 numbers into 3 groups \{1, 2\}, \{1, 2\}, \{1, 2\}. Thus the answer is (1 + 2)^2 + (1 + 2)^2 + (1 + 2)^2 = 27.


You are given two arrays a and b, each contains n integers.

You want to create a new array c as follows: choose some real (i.e. not necessarily integer) number d, and then for every i ∈ [1, n] let c_i := d ⋅ a_i + b_i.

Your goal is to maximize the number of zeroes in array c. What is the largest possible answer, if you choose d optimally?

Input

The first line contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of elements in both arrays.

The second line contains n integers a_1, a_2, ..., a_n (-10^9 ≤ a_i ≤ 10^9).

The third line contains n integers b_1, b_2, ..., b_n (-10^9 ≤ b_i ≤ 10^9).

Output

Print one integer — the maximum number of zeroes in array c, if you choose d optimally.

Examples

Input

5
1 2 3 4 5
2 4 7 11 3

Output

2

Input

3
13 37 39
1 2 3

Output

2

Input

4
0 0 0 0
1 2 3 4

Output

0

Input

3
1 2 -1
-6 -12 6

Output

3

Note

In the first example, we may choose d = -2.

In the second example, we may choose d = -1/13.

In the third example, we cannot obtain any zero in array c, no matter which d we choose.

In the fourth example, we may choose d = 6.


Polycarp has guessed three positive integers a, b and c. He keeps these numbers in secret, but he writes down four numbers on a board in arbitrary order — their pairwise sums (three numbers) and sum of all three numbers (one number). So, there are four numbers on a board in random order: a+b, a+c, b+c and a+b+c.

You have to guess three numbers a, b and c using given numbers. Print three guessed integers in any order.

Pay attention that some given numbers a, b and c can be equal (it is also possible that a=b=c).

Input

The only line of the input contains four positive integers x_1, x_2, x_3, x_4 (2 ≤ x_i ≤ 10^9) — numbers written on a board in random order. It is guaranteed that the answer exists for the given number x_1, x_2, x_3, x_4.

Output

Print such positive integers a, b and c that four numbers written on a board are values a+b, a+c, b+c and a+b+c written in some order. Print a, b and c in any order. If there are several answers, you can print any. It is guaranteed that the answer exists.

Examples

Input

3 6 5 4

Output

2 1 3

Input

40 40 40 60

Output

20 20 20

Input

201 101 101 200

Output

1 100 100


You have an array a_1, a_2, ..., a_n.

Let's call some subarray a_l, a_{l + 1}, ... , a_r of this array a subpermutation if it contains all integers from 1 to r-l+1 exactly once. For example, array a = [2, 2, 1, 3, 2, 3, 1] contains 6 subarrays which are subpermutations: [a_2 ... a_3], [a_2 ... a_4], [a_3 ... a_3], [a_3 ... a_5], [a_5 ... a_7], [a_7 ... a_7].

You are asked to calculate the number of subpermutations.

Input

The first line contains one integer n (1 ≤ n ≤ 3 ⋅ 10^5).

The second line contains n integers a_1, a_2, ... , a_n (1 ≤ a_i ≤ n).

This array can contain the same integers.

Output

Print the number of subpermutations of the array a.

Examples

Input

8
2 4 1 3 4 2 1 2

Output

7

Input

5
1 1 2 1 2

Output

6

Note

There are 7 subpermutations in the first test case. Their segments of indices are [1, 4], [3, 3], [3, 6], [4, 7], [6, 7], [7, 7] and [7, 8].

In the second test case 6 subpermutations exist: [1, 1], [2, 2], [2, 3], [3, 4], [4, 4] and [4, 5].


There are n segments drawn on a plane; the i-th segment connects two points (x_{i, 1}, y_{i, 1}) and (x_{i, 2}, y_{i, 2}). Each segment is non-degenerate, and is either horizontal or vertical — formally, for every i ∈ [1, n] either x_{i, 1} = x_{i, 2} or y_{i, 1} = y_{i, 2} (but only one of these conditions holds). Only segments of different types may intersect: no pair of horizontal segments shares any common points, and no pair of vertical segments shares any common points.

We say that four segments having indices h_1, h_2, v_1 and v_2 such that h_1 < h_2 and v_1 < v_2 form a rectangle if the following conditions hold:

  * segments h_1 and h_2 are horizontal;
  * segments v_1 and v_2 are vertical;
  * segment h_1 intersects with segment v_1;
  * segment h_2 intersects with segment v_1;
  * segment h_1 intersects with segment v_2;
  * segment h_2 intersects with segment v_2.

Please calculate the number of ways to choose four segments so they form a rectangle. Note that the conditions h_1 < h_2 and v_1 < v_2 should hold.

Input

The first line contains one integer n (1 ≤ n ≤ 5000) — the number of segments.

Then n lines follow. The i-th line contains four integers x_{i, 1}, y_{i, 1}, x_{i, 2} and y_{i, 2} denoting the endpoints of the i-th segment. All coordinates of the endpoints are in the range [-5000, 5000].

It is guaranteed that each segment is non-degenerate and is either horizontal or vertical. Furthermore, if two segments share a common point, one of these segments is horizontal, and another one is vertical.

Output

Print one integer — the number of ways to choose four segments so they form a rectangle.

Examples

Input

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

Output

7

Input

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

Output

0

Note

The following pictures represent sample cases:

<image> <image>


The Golden Ring is the special tourist route in Berland. This route consists of n cities and the cyclic railway route. Cities are numbered from 1 to n so that:

  * the next city for 1 is the city 2,
  * the next city for 2 is the city 3,
  * ...
  * the next city for n is the city 1.

Thus, the route is a cycle, cities are numbered in the direction of travel (the route is directed in one way).

Blogger Polycarp wants to start his journey in the city 1. For each city he knows the value a_i — how many selfies he wants to do in i-th city. He can take no more than one selfie in one visit to each city. Since he is traveling by train, he can't skip the city (he always moves from the city i to the city i+1 for 1 ≤ i < n and from n to 1). Thus, when the train stops in the city, Polycarp must visit this city. If Polycarp visits the city multiple times, all visits are counted separately.

What is the least number of city visits Polycarp will have to complete to fulfill his plan for the number of selfies for each city? Note that he always visits the city 1, since it is this city that his journey begins in.

Input

The first line contains an integer n (3 ≤ n ≤ 2⋅10^5) — the number of cities in the Golden Ring of Berland.

The next line contains n integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 10^9), where a_i is equal to the required number of selfies in the i-th city.

It is guaranteed that at least one of the numbers a_i is strictly greater than zero.

Output

Print a single integer — the required minimum number of visits.

Examples

Input

3
1 0 0

Output

1

Input

3
2 0 2

Output

6

Input

5
0 3 1 3 2

Output

14

Input

5
1000000000 1000000000 1000000000 1000000000 0

Output

4999999999


You are both a shop keeper and a shop assistant at a small nearby shop. You have n goods, the i-th good costs a_i coins.

You got tired of remembering the price of each product when customers ask for it, thus you decided to simplify your life. More precisely you decided to set the same price for all n goods you have.

However, you don't want to lose any money so you want to choose the price in such a way that the sum of new prices is not less than the sum of the initial prices. It means that if you sell all n goods for the new price, you will receive at least the same (or greater) amount of money as if you sell them for their initial prices.

On the other hand, you don't want to lose customers because of big prices so among all prices you can choose you need to choose the minimum one.

So you need to find the minimum possible equal price of all n goods so if you sell them for this price, you will receive at least the same (or greater) amount of money as if you sell them for their initial prices.

You have to answer q independent queries.

Input

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

The first line of the query contains one integer n (1 ≤ n ≤ 100) — the number of goods. The second line of the query contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^7), where a_i is the price of the i-th good.

Output

For each query, print the answer for it — the minimum possible equal price of all n goods so if you sell them for this price, you will receive at least the same (or greater) amount of money as if you sell them for their initial prices.

Example

Input

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

Output

3
2
1


Adding two numbers several times is a time-consuming task, so you want to build a robot. The robot should have a string S = S_1 S_2 ... S_N of N characters on its memory that represents addition instructions. Each character of the string, S_i, is either 'A' or 'B'.

You want to be able to give Q commands to the robot, each command is either of the following types:

  * 1 L R. The robot should toggle all the characters of S_i where L ≤ i ≤ R. Toggling a character means changing it to 'A' if it was previously 'B', or changing it to 'B' if it was previously 'A'.
  * 2 L R A B. The robot should call f(L, R, A, B) and return two integers as defined in the following pseudocode:

            function f(L, R, A, B):
          FOR i from L to R
            if S[i] = 'A'
              A = A + B
            else
              B = A + B
          return (A, B)

You want to implement the robot's expected behavior.

Input

Input begins with a line containing two integers: N Q (1 ≤ N, Q ≤ 100 000) representing the number of characters in the robot's memory and the number of commands, respectively. The next line contains a string S containing N characters (each either 'A' or 'B') representing the initial string in the robot's memory. The next Q lines each contains a command of the following types.

  * 1 L R (1 ≤ L ≤ R ≤ N)
  * 2 L R A B (1 ≤ L ≤ R ≤ N; 0 ≤ A, B ≤ 10^9)

There is at least one command of the second type.

Output

For each command of the second type in the same order as input, output in a line two integers (separated by a single space), the value of A and B returned by f(L, R, A, B), respectively. As this output can be large, you need to modulo the output by 1 000 000 007.

Example

Input

5 3
ABAAA
2 1 5 1 1
1 3 5
2 2 5 0 1000000000

Output

11 3
0 1000000000

Note

Explanation for the sample input/output #1

For the first command, calling f(L, R, A, B) causes the following:

  * Initially, A = 1 and B = 1.
  * At the end of i = 1, A = 2 and B = 1.
  * At the end of i = 2, A = 2 and B = 3.
  * At the end of i = 3, A = 5 and B = 3.
  * At the end of i = 4, A = 8 and B = 3.
  * At the end of i = 5, A = 11 and B = 3.

Therefore, f(L, R, A, B) will return (11, 3).

For the second command, string S will be updated to "ABBBB".

For the third command, the value of A will always be 0 and the value of B will always be 1 000 000 000. Therefore, f(L, R, A, B) will return (0, 1 000 000 000).


Vasya has a tree with n vertices numbered from 1 to n, and n - 1 edges numbered from 1 to n - 1. Initially each vertex contains a token with the number of the vertex written on it.

Vasya plays a game. He considers all edges of the tree by increasing of their indices. For every edge he acts as follows:

  * If both endpoints of the edge contain a token, remove a token from one of the endpoints and write down its number.
  * Otherwise, do nothing.

The result of the game is the sequence of numbers Vasya has written down. Note that there may be many possible resulting sequences depending on the choice of endpoints when tokens are removed.

Vasya has played for such a long time that he thinks he exhausted all possible resulting sequences he can obtain. He wants you to verify him by computing the number of distinct sequences modulo 998 244 353.

Input

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

The next n - 1 lines describe edges of the tree. The i-th of these lines contains two integers u_i, v_i (1 ≤ u_i, v_i ≤ n) — endpoints of the edge with index i. It is guaranteed that the given graph is indeed a tree.

Output

Print a single integer — the number of distinct sequences modulo 998 244 353.

Examples

Input

5
1 2
1 3
1 4
1 5

Output

5

Input

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

Output

10

Note

In the first sample case the distinct sequences are (1), (2, 1), (2, 3, 1), (2, 3, 4, 1), (2, 3, 4, 5).

Int the second sample case the distinct sequences are (2, 6, 5, 3), (2, 6, 5, 7), (2, 6, 7, 2), (2, 6, 7, 5), (2, 7, 3), (2, 7, 5), (7, 1, 3), (7, 1, 5), (7, 2, 3), (7, 2, 5).


This is an easy version of the problem. The actual problems are different, but the easy version is almost a subtask of the hard version. Note that the constraints and the output format are different.

You are given a string s consisting of n lowercase Latin letters.

You have to color all its characters one of the two colors (each character to exactly one color, the same letters can be colored the same or different colors, i.e. you can choose exactly one color for each index in s).

After coloring, you can swap any two neighboring characters of the string that are colored different colors. You can perform such an operation arbitrary (possibly, zero) number of times.

The goal is to make the string sorted, i.e. all characters should be in alphabetical order.

Your task is to say if it is possible to color the given string so that after coloring it can become sorted by some sequence of swaps. Note that you have to restore only coloring, not the sequence of swaps.

Input

The first line of the input contains one integer n (1 ≤ n ≤ 200) — the length of s.

The second line of the input contains the string s consisting of exactly n lowercase Latin letters.

Output

If it is impossible to color the given string so that after coloring it can become sorted by some sequence of swaps, print "NO" (without quotes) in the first line.

Otherwise, print "YES" in the first line and any correct coloring in the second line (the coloring is the string consisting of n characters, the i-th character should be '0' if the i-th character is colored the first color and '1' otherwise).

Examples

Input

9
abacbecfd

Output

YES
001010101

Input

8
aaabbcbb

Output

YES
01011011

Input

7
abcdedc

Output

NO

Input

5
abcde

Output

YES
00000


A queen is the strongest chess piece. In modern chess the queen can move any number of squares in any horizontal, vertical or diagonal direction (considering that there're no other pieces on its way). The queen combines the options given to the rook and the bishop.

There are m queens on a square n × n chessboard. You know each queen's positions, the i-th queen is positioned in the square (ri, ci), where ri is the board row number (numbered from the top to the bottom from 1 to n), and ci is the board's column number (numbered from the left to the right from 1 to n). No two queens share the same position.

For each queen one can count w — the number of other queens that the given queen threatens (attacks). For a fixed attack direction only the first queen in this direction is under attack if there are many queens are on the ray of the attack. Obviously, for any queen w is between 0 and 8, inclusive.

Print the sequence t0, t1, ..., t8, where ti is the number of queens that threaten exactly i other queens, i.e. the number of queens that their w equals i.

Input

The first line of the input contains a pair of integers n, m (1 ≤ n, m ≤ 105), where n is the size of the board and m is the number of queens on the board. Then m following lines contain positions of the queens, one per line. Each line contains a pair of integers ri, ci (1 ≤ ri, ci ≤ n) — the queen's position. No two queens stand on the same square.

Output

Print the required sequence t0, t1, ..., t8, separating the numbers with spaces.

Examples

Input

8 4
4 3
4 8
6 5
1 6

Output

0 3 0 1 0 0 0 0 0

Input

10 3
1 1
1 2
1 3

Output

0 2 1 0 0 0 0 0 0


You have array of n numbers a_{1}, a_{2}, …, a_{n}.

Rearrange these numbers to satisfy |a_{1} - a_{2}| ≤ |a_{2} - a_{3}| ≤ … ≤ |a_{n-1} - a_{n}|, where |x| denotes absolute value of x. It's always possible to find such rearrangement.

Note that all numbers in a are not necessarily different. In other words, some numbers of a may be same.

You have to answer independent t test cases.

Input

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

The first line of each test case contains single integer n (3 ≤ n ≤ 10^{5}) — the length of array a. It is guaranteed that the sum of values of n over all test cases in the input does not exceed 10^{5}.

The second line of each test case contains n integers a_{1}, a_{2}, …, a_{n} (-10^{9} ≤ a_{i} ≤ 10^{9}).

Output

For each test case, print the rearranged version of array a which satisfies given condition. If there are multiple valid rearrangements, print any of them.

Example

Input

2
6
5 -2 4 8 6 5
4
8 1 4 2

Output

5 5 4 6 8 -2
1 2 4 8

Note

In the first test case, after given rearrangement, |a_{1} - a_{2}| = 0 ≤ |a_{2} - a_{3}| = 1 ≤ |a_{3} - a_{4}| = 2 ≤ |a_{4} - a_{5}| = 2 ≤ |a_{5} - a_{6}| = 10. There are other possible answers like "5 4 5 6 -2 8".

In the second test case, after given rearrangement, |a_{1} - a_{2}| = 1 ≤ |a_{2} - a_{3}| = 2 ≤ |a_{3} - a_{4}| = 4. There are other possible answers like "2 4 8 1".


You are given n strings a_1, a_2, …, a_n: all of them have the same length m. The strings consist of lowercase English letters.

Find any string s of length m such that each of the given n strings differs from s in at most one position. Formally, for each given string a_i, there is no more than one position j such that a_i[j] ≠ s[j].

Note that the desired string s may be equal to one of the given strings a_i, or it may differ from all the given strings.

For example, if you have the strings abac and zbab, then the answer to the problem might be the string abab, which differs from the first only by the last character, and from the second only by the first.

Input

The first line contains an integer t (1 ≤ t ≤ 100) — the number of test cases. Then t test cases follow.

Each test case starts with a line containing two positive integers n (1 ≤ n ≤ 10) and m (1 ≤ m ≤ 10) — the number of strings and their length.

Then follow n strings a_i, one per line. Each of them has length m and consists of lowercase English letters.

Output

Print t answers to the test cases. Each answer (if it exists) is a string of length m consisting of lowercase English letters. If there are several answers, print any of them. If the answer does not exist, print "-1" ("minus one", without quotes).

Example

Input

5
2 4
abac
zbab
2 4
aaaa
bbbb
3 3
baa
aaa
aab
2 2
ab
bb
3 1
a
b
c

Output

abab
-1
aaa
ab
z

Note

The first test case was explained in the statement.

In the second test case, the answer does not exist.


You are creating a level for a video game. The level consists of n rooms placed in a circle. The rooms are numbered 1 through n. Each room contains exactly one exit: completing the j-th room allows you to go the (j+1)-th room (and completing the n-th room allows you to go the 1-st room).

You are given the description of the multiset of n chests: the i-th chest has treasure value c_i.

Each chest can be of one of two types:

  * regular chest — when a player enters a room with this chest, he grabs the treasure and proceeds to the next room;
  * mimic chest — when a player enters a room with this chest, the chest eats him alive, and he loses.

The player starts in a random room with each room having an equal probability of being chosen. The players earnings is equal to the total value of treasure chests he'd collected before he lost.

You are allowed to choose the order the chests go into the rooms. For each k from 1 to n place the chests into the rooms in such a way that:

  * each room contains exactly one chest;
  * exactly k chests are mimics;
  * the expected value of players earnings is minimum possible.

Please note that for each k the placement is chosen independently.

It can be shown that it is in the form of P/Q where P and Q are non-negative integers and Q ≠ 0. Report the values of P ⋅ Q^{-1} \pmod {998244353}.

Input

The first contains a single integer n (2 ≤ n ≤ 3 ⋅ 10^5) — the number of rooms and the number of chests.

The second line contains n integers c_1, c_2, ..., c_n (1 ≤ c_i ≤ 10^6) — the treasure values of each chest.

Output

Print n integers — the k -th value should be equal to the minimum possible expected value of players earnings if the chests are placed into the rooms in some order and exactly k of the chests are mimics.

It can be shown that it is in the form of P/Q where P and Q are non-negative integers and Q ≠ 0. Report the values of P ⋅ Q^{-1} \pmod {998244353}.

Examples

Input

2
1 2

Output

499122177 0

Input

8
10 4 3 6 5 10 7 5

Output

499122193 249561095 249561092 873463811 499122178 124780545 623902721 0

Note

In the first example the exact values of minimum expected values are: \frac 1 2, \frac 0 2.

In the second example the exact values of minimum expected values are: \frac{132} 8, \frac{54} 8, \frac{30} 8, \frac{17} 8, \frac{12} 8, \frac 7 8, \frac 3 8, \frac 0 8.


Polycarp plays a (yet another!) strategic computer game. In this game, he leads an army of mercenaries.

Polycarp wants to gather his army for a quest. There are n mercenaries for hire, and the army should consist of some subset of them.

The i-th mercenary can be chosen if the resulting number of chosen mercenaries is not less than l_i (otherwise he deems the quest to be doomed) and not greater than r_i (he doesn't want to share the trophies with too many other mercenaries). Furthermore, m pairs of mercenaries hate each other and cannot be chosen for the same quest.

How many non-empty subsets does Polycarp need to consider? In other words, calculate the number of non-empty subsets of mercenaries such that the size of this subset belongs to [l_i, r_i] for each chosen mercenary, and there are no two mercenaries in the subset that hate each other.

The answer may be large, so calculate it modulo 998244353.

Input

The first line contains two integers n and m (1 ≤ n ≤ 3 ⋅ 10^5, 0 ≤ m ≤ min(20, (n(n-1))/(2))) — the number of mercenaries and the number of pairs of mercenaries that hate each other.

Then n lines follow, the i-th of them contains two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ n).

Then m lines follow, the i-th of them contains two integers a_i and b_i (1 ≤ a_i < b_i ≤ n) denoting that the mercenaries a_i and b_i hate each other. There are no two equal pairs in this list.

Output

Print one integer — the number of non-empty subsets meeting the constraints, taken modulo 998244353.

Examples

Input

3 0
1 1
2 3
1 3

Output

3

Input

3 1
1 1
2 3
1 3
2 3

Output

2


During one of the space missions, humans have found an evidence of previous life at one of the planets. They were lucky enough to find a book with birth and death years of each individual that had been living at this planet. What's interesting is that these years are in the range (1, 10^9)! Therefore, the planet was named Longlifer.

In order to learn more about Longlifer's previous population, scientists need to determine the year with maximum number of individuals that were alive, as well as the number of alive individuals in that year. Your task is to help scientists solve this problem!

Input

The first line contains an integer n (1 ≤ n ≤ 10^5) — the number of people.

Each of the following n lines contain two integers b and d (1 ≤ b < d ≤ 10^9) representing birth and death year (respectively) of each individual.

Output

Print two integer numbers separated by blank character, y — the year with a maximum number of people alive and k — the number of people alive in year y.

In the case of multiple possible solutions, print the solution with minimum year.

Examples

Input

3
1 5
2 4
5 6

Output

2 2

Input

4
3 4
4 5
4 6
8 10

Output

4 2

Note

You can assume that an individual living from b to d has been born at the beginning of b and died at the beginning of d, and therefore living for d - b years.


Oleg's favorite subjects are History and Math, and his favorite branch of mathematics is division.

To improve his division skills, Oleg came up with t pairs of integers p_i and q_i and for each pair decided to find the greatest integer x_i, such that:

  * p_i is divisible by x_i;
  * x_i is not divisible by q_i.

Oleg is really good at division and managed to find all the answers quickly, how about you?

Input

The first line contains an integer t (1 ≤ t ≤ 50) — the number of pairs.

Each of the following t lines contains two integers p_i and q_i (1 ≤ p_i ≤ 10^{18}; 2 ≤ q_i ≤ 10^{9}) — the i-th pair of integers.

Output

Print t integers: the i-th integer is the largest x_i such that p_i is divisible by x_i, but x_i is not divisible by q_i.

One can show that there is always at least one value of x_i satisfying the divisibility conditions for the given constraints.

Example

Input

3
10 4
12 6
179 822

Output

10
4
179

Note

For the first pair, where p_1 = 10 and q_1 = 4, the answer is x_1 = 10, since it is the greatest divisor of 10 and 10 is not divisible by 4.

For the second pair, where p_2 = 12 and q_2 = 6, note that

  * 12 is not a valid x_2, since 12 is divisible by q_2 = 6;
  * 6 is not valid x_2 as well: 6 is also divisible by q_2 = 6.

The next available divisor of p_2 = 12 is 4, which is the answer, since 4 is not divisible by 6.


Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya has two strings a and b of the same length n. The strings consist only of lucky digits. Petya can perform operations of two types:

  * replace any one digit from string a by its opposite (i.e., replace 4 by 7 and 7 by 4);
  * swap any pair of digits in string a.

Petya is interested in the minimum number of operations that are needed to make string a equal to string b. Help him with the task.

Input

The first and the second line contains strings a and b, correspondingly. Strings a and b have equal lengths and contain only lucky digits. The strings are not empty, their length does not exceed 105.

Output

Print on the single line the single number — the minimum number of operations needed to convert string a into string b.

Examples

Input

47
74

Output

1

Input

774
744

Output

1

Input

777
444

Output

3

Note

In the first sample it is enough simply to swap the first and the second digit.

In the second sample we should replace the second digit with its opposite.

In the third number we should replace all three digits with their opposites.


Qingshan and Daniel are going to play a card game. But it will be so boring if only two persons play this. So they will make n robots in total to play this game automatically. Robots made by Qingshan belong to the team 1, and robots made by Daniel belong to the team 2. Robot i belongs to team t_i. Before the game starts, a_i cards are given for robot i.

The rules for this card game are simple:

  * Before the start, the robots are arranged in a circle in the order or their indices. The robots will discard cards in some order, in each step one robot discards a single card. When the game starts, robot 1 will discard one of its cards. After that, robots will follow the following rules:
  * If robot i discards the card last, the nearest robot whose team is opposite from i's will discard the card next. In another word j will discard a card right after i, if and only if among all j that satisfy t_i≠ t_j, dist(i,j) (definition is below) is minimum.
  * The robot who has no cards should quit the game immediately. This robot won't be considered in the next steps.
  * When no robot can discard the card next, the game ends.

We define the distance from robot x to robot y as dist(x,y)=(y-x+n)mod n. It is similar to the oriented distance on the circle.

For example, when n=5, the distance from 1 to 3 is dist(1,3)=(3-1+5)mod 5=2, the distance from 3 to 1 is dist(3,1)=(1-3+5)mod 5 =3.

Later, Qingshan finds out that it will take so much time to see how robots play. She wants to know the result as quickly as possible. You, as Qingshan's fan, are asked to calculate an array [ans_1,ans_2,…,ans_n] — ans_i is equal to the number of cards, that i-th robot will discard during the game. You need to hurry!

To avoid the large size of the input, the team and the number of cards of each robot will be generated in your code with some auxiliary arrays.

Input

The first line contains one integer n (1 ≤ n ≤ 5⋅ 10^6) — the number of robots playing this game.

The second line contains one integer m (1 ≤ m ≤ min(n,200 000)).

Each of the next m line contains four integers p_i, k_i, b_i, w_i (1 ≤ p_i ≤ n, 1 ≤ k_i ≤ 10^9+7, 0 ≤ b_i ,w_i< k_i). It's guaranteed that p_m=n and p_{j-1}<p_{j} (2 ≤ j ≤ m).

Arrays a_j and t_j should be generated by the following pseudo code:

    seed = 0
    base = 0

    function rnd():
    	ret = seed
    	seed = (seed * base + 233) mod 1000000007
    	return ret

    p[0] = 0
    for i = 1 to m:
    	seed = b[i]
    	base = w[i]
    	for j = p[i - 1] + 1 to p[i]:
    		t[j] = (rnd() mod 2) + 1
    		a[j] = (rnd() mod k[i]) + 1

Output

Print a single integer \left( ∏_{i=1}^{n} ((ans_i ⊕ i^2)+1)\right) mod 10^9+7, where ⊕ denotes the [bitwise XOR operation](https://en.wikipedia.org/wiki/Bitwise_operation#XOR).

Examples

Input

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

Output

100

Input

5000000
2
1919810 998244353 114514 19260817
5000000 233333333 623532 7175

Output

800210675

Input

1
1
1 1 0 0

Output

1

Note

In the first test case a=[5,5,1] and t=[1,2,2].

The robot 1 discards the card first.

Then robot 2 discards the card next. Robot 3 doesn't discard the card next because dist(1,2)<dist(1,3).

Then robot 1 discards the card next. Robot 3 doesn't discard the card next because t_2=t_3.

If we write down the index of the robot who discards a card in time order, it will be the sequence [1,2,1,2,1,2,1,2]. So robots 1, 2 and 3 discard 5, 5 and 0 cards, respectively. And the answer is (((5 ⊕ 1^2)+1)×((5 ⊕ 2^2)+1)×((0 ⊕ 3^2)+1)) mod 10^9+7=(5× 2 × 10)mod 10^9+7=100.


There is a n × m grid. You are standing at cell (1, 1) and your goal is to finish at cell (n, m).

You can move to the neighboring cells to the right or down. In other words, suppose you are standing at cell (x, y). You can:

  * move right to the cell (x, y + 1) — it costs x burles;
  * move down to the cell (x + 1, y) — it costs y burles.

Can you reach cell (n, m) spending exactly k burles?

Input

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

The first and only line of each test case contains three integers n, m, and k (1 ≤ n, m ≤ 100; 0 ≤ k ≤ 10^4) — the sizes of grid and the exact amount of money you need to spend.

Output

For each test case, if you can reach cell (n, m) spending exactly k burles, print YES. Otherwise, print NO.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).

Example

Input

6
1 1 0
2 2 2
2 2 3
2 2 4
1 4 3
100 100 10000

Output

YES
NO
YES
NO
YES
NO

Note

In the first test case, you are already in the final cell, so you spend 0 burles.

In the second, third and fourth test cases, there are two paths from (1, 1) to (2, 2): (1, 1) → (1, 2) → (2, 2) or (1, 1) → (2, 1) → (2, 2). Both costs 1 + 2 = 3 burles, so it's the only amount of money you can spend.

In the fifth test case, there is the only way from (1, 1) to (1, 4) and it costs 1 + 1 + 1 = 3 burles.


AquaMoon had n strings of length m each. n is an odd number.

When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!

In her rage, she disrupted each pair of strings. For each pair, she selected some positions (at least 1 and at most m) and swapped the letters in the two strings of this pair at the selected positions.

For example, if m = 6 and two strings "abcdef" and "xyzklm" are in one pair and Cirno selected positions 2, 3 and 6 she will swap 'b' with 'y', 'c' with 'z' and 'f' with 'm'. The resulting strings will be "ayzdem" and "xbcklf".

Cirno then stole away the string without pair and shuffled all remaining strings in arbitrary order.

AquaMoon found the remaining n-1 strings in complete disarray. Also, she remembers the initial n strings. She wants to know which string was stolen, but she is not good at programming. Can you help her?

Input

This problem is made as interactive. It means, that your solution will read the input, given by the interactor. But the interactor will give you the full input at the beginning and after that, you should print the answer. So you should solve the problem, like as you solve the usual, non-interactive problem because you won't have any interaction process. The only thing you should not forget is to flush the output buffer, after printing the answer. Otherwise, you can get an "Idleness limit exceeded" verdict. Refer to the [interactive problems guide](https://codeforces.com/blog/entry/45307) for the detailed information about flushing the output buffer.

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 two integers n, m (1 ≤ n ≤ 10^5, 1 ≤ m ≤ 10^5) — the number of strings and the length of each string, respectively.

The next n lines each contain a string with length m, describing the original n strings. All string consists of lowercase Latin letters.

The next n-1 lines each contain a string with length m, describing the strings after Cirno exchanged and reordered them.

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

Hack format:

The first line should contain a single integer t. After that t test cases should follow in the following format:

The first line should contain two integers n and m.

The following n lines should contain n strings of length m, describing the original strings.

The following (n-1)/(2) lines should describe the pairs. They should contain, in the following order: the index of the first string i (1 ≤ i ≤ n), the index of the second string j (1 ≤ j ≤ n, i ≠ j), the number of exchanged positions k (1 ≤ k ≤ m), and the list of k positions that are exchanged (k distinct indices from 1 to m in any order).

The final line should contain a permutation of integers from 1 to n, describing the way the strings should be reordered. The strings will be placed in the order indices placed in this permutation, the stolen string index will be ignored.

Output

For each test case print a single line with the stolen string.

Example

Input

3
3 5
aaaaa
bbbbb
ccccc
aaaaa
bbbbb
3 4
aaaa
bbbb
cccc
aabb
bbaa
5 6
abcdef
uuuuuu
kekeke
ekekek
xyzklm
xbcklf
eueueu
ayzdem
ukukuk

Output

ccccc
cccc
kekeke

Note

In the first test case, "aaaaa" and "bbbbb" exchanged all positions, and "ccccc" is the stolen string.

In the second test case, "aaaa" and "bbbb" exchanged two first positions, and "cccc" is the stolen string.

This is the first test in the hack format:

    3
    3 5
    aaaaa
    bbbbb
    ccccc
    1 2 5 1 2 3 4 5
    2 1 3
    3 4
    aaaa
    bbbb
    cccc
    1 2 2 1 2
    2 1 3
    5 6
    abcdef
    uuuuuu
    kekeke
    ekekek
    xyzklm
    1 5 3 2 3 6
    2 4 3 2 4 6
    5 4 1 2 3


Let's consider a k × k square, divided into unit squares. Please note that k ≥ 3 and is odd. We'll paint squares starting from the upper left square in the following order: first we move to the right, then down, then to the left, then up, then to the right again and so on. We finish moving in some direction in one of two cases: either we've reached the square's border or the square following after the next square is already painted. We finish painting at the moment when we cannot move in any direction and paint a square. The figure that consists of the painted squares is a spiral.

<image> The figure shows examples of spirals for k = 3, 5, 7, 9.

You have an n × m table, each of its cells contains a number. Let's consider all possible spirals, formed by the table cells. It means that we consider all spirals of any size that don't go beyond the borders of the table. Let's find the sum of the numbers of the cells that form the spiral. You have to find the maximum of those values among all spirals.

Input

The first line contains two integers n and m (3 ≤ n, m ≤ 500) — the sizes of the table.

Each of the next n lines contains m space-separated integers: the j-th number in the i-th line aij ( - 1000 ≤ aij ≤ 1000) is the number recorded in the j-th cell of the i-th row of the table.

Output

Print a single number — the maximum sum of numbers among all spirals.

Examples

Input

6 5
0 0 0 0 0
1 1 1 1 1
0 0 0 0 1
1 1 1 0 1
1 0 0 0 1
1 1 1 1 1

Output

17

Input

3 3
1 1 1
1 0 0
1 1 1

Output

6

Input

6 6
-3 2 0 1 5 -1
4 -1 2 -3 0 1
-5 1 2 4 1 -2
0 -2 1 3 -1 2
3 1 4 -3 -2 0
-1 2 -1 3 1 2

Output

13

Note

In the first sample the spiral with maximum sum will cover all 1's of the table.

In the second sample the spiral may cover only six 1's.


Nick has some permutation consisting of p integers from 1 to n. A segment [l, r] (l ≤ r) is a set of elements pi satisfying l ≤ i ≤ r.

Nick calls a pair of segments [a0, a1] and [b0, b1] (1 ≤ a0 ≤ a1 < b0 ≤ b1 ≤ n) good if all their (a1 - a0 + b1 - b0 + 2) elements, when sorted in ascending order, form an arithmetic progression with a difference of 1. That is, when they sorted in ascending order, the elements are in the form {x, x + 1, x + 2, ..., x + m - 1}, for some x and m.

Your task is to find the number of distinct pairs of good segments in the given permutation. Two pairs of segments are considered distinct if the sets of elements contained in these pairs of segments are distinct. For example, any segment [l, r] (l < r) can be represented as a pair of segments, as [l, i] and [i + 1, r] (l ≤ i ≤ r). As all these pairs consist of the same set of elements, they are considered identical.

See the notes accompanying the sample tests for clarification.

Input

The first line contains integer n (1 ≤ n ≤ 3·105) — the permutation size. The second line contains n space-separated distinct integers pi, (1 ≤ pi ≤ n).

Output

Print a single integer — the number of good pairs of segments of permutation p.

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
1 2 3

Output

3

Input

5
1 4 5 3 2

Output

10

Input

5
5 4 3 1 2

Output

10

Note

In the first sample the following pairs of segments are good: ([1, 1], [2, 2]); ([2, 2], [3, 3]); ([1, 2], [3, 3]). Pair of segments ([1, 1], [2, 3]) is by definition equivalent to pair ([1, 2], [3, 3]), since both of them covers the same set of elements, namely {1, 2, 3}.

In the third sample the following pairs of segments are good: ([4, 4], [5, 5]); ([3, 3],[4, 5]); ([2, 2],[3, 5]); ([1, 1],[2, 5]); ([3, 3],[5, 5]); ([2, 3],[5, 5]); ([1, 3],[5, 5]); ([2, 2],[3, 3]); ([1, 1],[2, 3]); ([1, 1],[2, 2]).


Byteland is trying to send a space mission onto the Bit-X planet. Their task is complicated by the fact that the orbit of the planet is regularly patrolled by Captain Bitonix, the leader of the space forces of Bit-X.

There are n stations around Bit-X numbered clockwise from 1 to n. The stations are evenly placed on a circular orbit, so the stations number i and i + 1 (1 ≤ i < n), and the stations number 1 and n, are neighboring. The distance between every pair of adjacent stations is equal to m space miles. To go on a patrol, Captain Bitonix jumps in his rocket at one of the stations and flies in a circle, covering a distance of at least one space mile, before finishing in some (perhaps the starting) station.

Bitonix' rocket moves by burning fuel tanks. After Bitonix attaches an x-liter fuel tank and chooses the direction (clockwise or counter-clockwise), the rocket flies exactly x space miles along a circular orbit in the chosen direction. Note that the rocket has no brakes; it is not possible for the rocket to stop before depleting a fuel tank.

For example, assume that n = 3 and m = 60 and Bitonix has fuel tanks with volumes of 10, 60, 90 and 100 liters. If Bitonix starts from station 1, uses the 100-liter fuel tank to go clockwise, then uses the 90-liter fuel tank to go clockwise, and then uses the 10-liter fuel tank to go counterclockwise, he will finish back at station 1. This constitutes a valid patrol. Note that Bitonix does not have to use all available fuel tanks. Another valid option for Bitonix in this example would be to simply use the 60-liter fuel tank to fly to either station 2 or 3.

However, if n was equal to 3, m was equal to 60 and the only fuel tanks available to Bitonix were one 10-liter tank and one 100-liter tank, he would have no way of completing a valid patrol (he wouldn't be able to finish any patrol exactly at the station).

The Byteland space agency wants to destroy some of Captain Bitonix' fuel tanks so that he cannot to complete any valid patrol. Find how many different subsets of the tanks the agency can destroy to prevent Captain Bitonix from completing a patrol and output the answer modulo 1000000007 (109 + 7).

Input

The first line of the input contains three integers n (2 ≤ n ≤ 1000) — the number of stations, m (1 ≤ m ≤ 120) — the distance between adjacent stations, and t (1 ≤ t ≤ 10000) — the number of fuel tanks owned by Captain Bitonix.

The second line of the input contains t space-separated integers between 1 and 109, inclusive — the volumes of Bitonix' fuel tanks.

Output

Output a single number — the number of distinct subsets of tanks that the Bytelandian space agency can destroy in order to prevent Captain Bitonix from completing a patrol, modulo 109 + 7.

Examples

Input

7 6 5
5 4 12 6 5

Output

6

Input

3 60 2
10 100

Output

4

Note

All the fuel tanks are distinct, even if some of them have the same capacity.


Mirror Box is a name of a popular game in the Iranian National Amusement Park (INAP). There is a wooden box, 105 cm long and 100 cm high in this game. Some parts of the box's ceiling and floor are covered by mirrors. There are two negligibly small holes in the opposite sides of the box at heights hl and hr centimeters above the floor. The picture below shows what the box looks like.

<image>

In the game, you will be given a laser gun to shoot once. The laser beam must enter from one hole and exit from the other one. Each mirror has a preset number vi, which shows the number of points players gain if their laser beam hits that mirror. Also — to make things even funnier — the beam must not hit any mirror more than once.

Given the information about the box, your task is to find the maximum score a player may gain. Please note that the reflection obeys the law "the angle of incidence equals the angle of reflection".

Input

The first line of the input contains three space-separated integers hl, hr, n (0 < hl, hr < 100, 0 ≤ n ≤ 100) — the heights of the holes and the number of the mirrors.

Next n lines contain the descriptions of the mirrors. The i-th line contains space-separated vi, ci, ai, bi; the integer vi (1 ≤ vi ≤ 1000) is the score for the i-th mirror; the character ci denotes i-th mirror's position — the mirror is on the ceiling if ci equals "T" and on the floor if ci equals "F"; integers ai and bi (0 ≤ ai < bi ≤ 105) represent the x-coordinates of the beginning and the end of the mirror.

No two mirrors will share a common point. Consider that the x coordinate increases in the direction from left to right, so the border with the hole at height hl has the x coordinate equal to 0 and the border with the hole at height hr has the x coordinate equal to 105.

Output

The only line of output should contain a single integer — the maximum possible score a player could gain.

Examples

Input

50 50 7
10 F 1 80000
20 T 1 80000
30 T 81000 82000
40 T 83000 84000
50 T 85000 86000
60 T 87000 88000
70 F 81000 89000

Output

100

Input

80 72 9
15 T 8210 15679
10 F 11940 22399
50 T 30600 44789
50 F 32090 36579
5 F 45520 48519
120 F 49250 55229
8 F 59700 80609
35 T 61940 64939
2 T 92540 97769

Output

120

Note

The second sample is depicted above. The red beam gets 10 + 50 + 5 + 35 + 8 + 2 = 110 points and the blue one gets 120.

The red beam on the picture given in the statement shows how the laser beam can go approximately, this is just illustration how the laser beam can gain score. So for the second sample there is no such beam that gain score 110.


During the break the schoolchildren, boys and girls, formed a queue of n people in the canteen. Initially the children stood in the order they entered the canteen. However, after a while the boys started feeling awkward for standing in front of the girls in the queue and they started letting the girls move forward each second.

Let's describe the process more precisely. Let's say that the positions in the queue are sequentially numbered by integers from 1 to n, at that the person in the position number 1 is served first. Then, if at time x a boy stands on the i-th position and a girl stands on the (i + 1)-th position, then at time x + 1 the i-th position will have a girl and the (i + 1)-th position will have a boy. The time is given in seconds.

You've got the initial position of the children, at the initial moment of time. Determine the way the queue is going to look after t seconds.

Input

The first line contains two integers n and t (1 ≤ n, t ≤ 50), which represent the number of children in the queue and the time after which the queue will transform into the arrangement you need to find.

The next line contains string s, which represents the schoolchildren's initial arrangement. If the i-th position in the queue contains a boy, then the i-th character of string s equals "B", otherwise the i-th character equals "G".

Output

Print string a, which describes the arrangement after t seconds. If the i-th position has a boy after the needed time, then the i-th character a must equal "B", otherwise it must equal "G".

Examples

Input

5 1
BGGBG

Output

GBGGB

Input

5 2
BGGBG

Output

GGBGB

Input

4 1
GGGB

Output

GGGB


One day n cells of some array decided to play the following game. Initially each cell contains a number which is equal to it's ordinal number (starting from 1). Also each cell determined it's favourite number. On it's move i-th cell can exchange it's value with the value of some other j-th cell, if |i - j| = di, where di is a favourite number of i-th cell. Cells make moves in any order, the number of moves is unlimited.

The favourite number of each cell will be given to you. You will also be given a permutation of numbers from 1 to n. You are to determine whether the game could move to this state.

Input

The first line contains positive integer n (1 ≤ n ≤ 100) — the number of cells in the array. The second line contains n distinct integers from 1 to n — permutation. The last line contains n integers from 1 to n — favourite numbers of the cells.

Output

If the given state is reachable in the described game, output YES, otherwise NO.

Examples

Input

5
5 4 3 2 1
1 1 1 1 1

Output

YES

Input

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

Output

NO

Input

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

Output

YES


Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms:

  1. Make vi-th array element equal to xi. In other words, perform the assignment avi = xi.
  2. Increase each array element by yi. In other words, perform n assignments ai = ai + yi (1 ≤ i ≤ n).
  3. Take a piece of paper and write out the qi-th array element. That is, the element aqi.

Help Sereja, complete all his operations.

Input

The first line contains integers n, m (1 ≤ n, m ≤ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the original array.

Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≤ ti ≤ 3) that represents the operation type. If ti = 1, then it is followed by two integers vi and xi, (1 ≤ vi ≤ n, 1 ≤ xi ≤ 109). If ti = 2, then it is followed by integer yi (1 ≤ yi ≤ 104). And if ti = 3, then it is followed by integer qi (1 ≤ qi ≤ n).

Output

For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.

Examples

Input

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

Output

2
9
11
20
30
40
39


Paladin Manao caught the trail of the ancient Book of Evil in a swampy area. This area contains n settlements numbered from 1 to n. Moving through the swamp is very difficult, so people tramped exactly n - 1 paths. Each of these paths connects some pair of settlements and is bidirectional. Moreover, it is possible to reach any settlement from any other one by traversing one or several paths.

The distance between two settlements is the minimum number of paths that have to be crossed to get from one settlement to the other one. Manao knows that the Book of Evil has got a damage range d. This means that if the Book of Evil is located in some settlement, its damage (for example, emergence of ghosts and werewolves) affects other settlements at distance d or less from the settlement where the Book resides.

Manao has heard of m settlements affected by the Book of Evil. Their numbers are p1, p2, ..., pm. Note that the Book may be affecting other settlements as well, but this has not been detected yet. Manao wants to determine which settlements may contain the Book. Help him with this difficult task.

Input

The first line contains three space-separated integers n, m and d (1 ≤ m ≤ n ≤ 100000; 0 ≤ d ≤ n - 1). The second line contains m distinct space-separated integers p1, p2, ..., pm (1 ≤ pi ≤ n). Then n - 1 lines follow, each line describes a path made in the area. A path is described by a pair of space-separated integers ai and bi representing the ends of this path.

Output

Print a single number — the number of settlements that may contain the Book of Evil. It is possible that Manao received some controversial information and there is no settlement that may contain the Book. In such case, print 0.

Examples

Input

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

Output

3

Note

Sample 1. The damage range of the Book of Evil equals 3 and its effects have been noticed in settlements 1 and 2. Thus, it can be in settlements 3, 4 or 5.

<image>


Levko loves array a1, a2, ... , an, consisting of integers, very much. That is why Levko is playing with array a, performing all sorts of operations with it. Each operation Levko performs is of one of two types:

  1. Increase all elements from li to ri by di. In other words, perform assignments aj = aj + di for all j that meet the inequation li ≤ j ≤ ri.
  2. Find the maximum of elements from li to ri. That is, calculate the value <image>.

Sadly, Levko has recently lost his array. Fortunately, Levko has records of all operations he has performed on array a. Help Levko, given the operation records, find at least one suitable array. The results of all operations for the given array must coincide with the record results. Levko clearly remembers that all numbers in his array didn't exceed 109 in their absolute value, so he asks you to find such an array.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 5000) — the size of the array and the number of operations in Levko's records, correspondingly.

Next m lines describe the operations, the i-th line describes the i-th operation. The first integer in the i-th line is integer ti (1 ≤ ti ≤ 2) that describes the operation type. If ti = 1, then it is followed by three integers li, ri and di (1 ≤ li ≤ ri ≤ n,  - 104 ≤ di ≤ 104) — the description of the operation of the first type. If ti = 2, then it is followed by three integers li, ri and mi (1 ≤ li ≤ ri ≤ n,  - 5·107 ≤ mi ≤ 5·107) — the description of the operation of the second type.

The operations are given in the order Levko performed them on his array.

Output

In the first line print "YES" (without the quotes), if the solution exists and "NO" (without the quotes) otherwise.

If the solution exists, then on the second line print n integers a1, a2, ... , an (|ai| ≤ 109) — the recovered array.

Examples

Input

4 5
1 2 3 1
2 1 2 8
2 3 4 7
1 1 3 3
2 3 4 8

Output

YES
4 7 4 7

Input

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

Output

NO


Iahub accidentally discovered a secret lab. He found there n devices ordered in a line, numbered from 1 to n from left to right. Each device i (1 ≤ i ≤ n) can create either ai units of matter or ai units of antimatter.

Iahub wants to choose some contiguous subarray of devices in the lab, specify the production mode for each of them (produce matter or antimatter) and finally take a photo of it. However he will be successful only if the amounts of matter and antimatter produced in the selected subarray will be the same (otherwise there would be overflowing matter or antimatter in the photo).

You are requested to compute the number of different ways Iahub can successful take a photo. A photo is different than another if it represents another subarray, or if at least one device of the subarray is set to produce matter in one of the photos and antimatter in the other one.

Input

The first line contains an integer n (1 ≤ n ≤ 1000). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 1000).

The sum a1 + a2 + ... + an will be less than or equal to 10000.

Output

Output a single integer, the number of ways Iahub can take a photo, modulo 1000000007 (109 + 7).

Examples

Input

4
1 1 1 1

Output

12

Note

The possible photos are [1+, 2-], [1-, 2+], [2+, 3-], [2-, 3+], [3+, 4-], [3-, 4+], [1+, 2+, 3-, 4-], [1+, 2-, 3+, 4-], [1+, 2-, 3-, 4+], [1-, 2+, 3+, 4-], [1-, 2+, 3-, 4+] and [1-, 2-, 3+, 4+], where "i+" means that the i-th element produces matter, and "i-" means that the i-th element produces antimatter.


Valera had an undirected connected graph without self-loops and multiple edges consisting of n vertices. The graph had an interesting property: there were at most k edges adjacent to each of its vertices. For convenience, we will assume that the graph vertices were indexed by integers from 1 to n.

One day Valera counted the shortest distances from one of the graph vertices to all other ones and wrote them out in array d. Thus, element d[i] of the array shows the shortest distance from the vertex Valera chose to vertex number i.

Then something irreparable terrible happened. Valera lost the initial graph. However, he still has the array d. Help him restore the lost graph.

Input

The first line contains two space-separated integers n and k (1 ≤ k < n ≤ 105). Number n shows the number of vertices in the original graph. Number k shows that at most k edges were adjacent to each vertex in the original graph.

The second line contains space-separated integers d[1], d[2], ..., d[n] (0 ≤ d[i] < n). Number d[i] shows the shortest distance from the vertex Valera chose to the vertex number i.

Output

If Valera made a mistake in his notes and the required graph doesn't exist, print in the first line number -1. Otherwise, in the first line print integer m (0 ≤ m ≤ 106) — the number of edges in the found graph.

In each of the next m lines print two space-separated integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi), denoting the edge that connects vertices with numbers ai and bi. The graph shouldn't contain self-loops and multiple edges. If there are multiple possible answers, print any of them.

Examples

Input

3 2
0 1 1

Output

3
1 2
1 3
3 2

Input

4 2
2 0 1 3

Output

3
1 3
1 4
2 3

Input

3 1
0 0 0

Output

-1


One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary representation contains exactly k digits one".

The girl got interested in the task and she asked you to help her solve it. Sasha knows that you are afraid of large numbers, so she guaranteed that there is an answer that doesn't exceed 1018.

Input

The first line contains two space-separated integers, m and k (0 ≤ m ≤ 1018; 1 ≤ k ≤ 64).

Output

Print the required number n (1 ≤ n ≤ 1018). If there are multiple answers, print any of them.

Examples

Input

1 1

Output

1

Input

3 2

Output

5


Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n is odd; n > 1) is an n × n matrix with a diamond inscribed into it.

You are given an odd integer n. You need to draw a crystal of size n. The diamond cells of the matrix should be represented by character "D". All other cells of the matrix should be represented by character "*". Look at the examples to understand what you need to draw.

Input

The only line contains an integer n (3 ≤ n ≤ 101; n is odd).

Output

Output a crystal of size n.

Examples

Input

3

Output

*D*
DDD
*D*

Input

5

Output

**D**
*DDD*
DDDDD
*DDD*
**D**

Input

7

Output

***D***
**DDD**
*DDDDD*
DDDDDDD
*DDDDD*
**DDD**
***D***


Dreamoon likes to play with sets, integers and <image>. <image> is defined as the largest positive integer that divides both a and b.

Let S be a set of exactly four distinct integers greater than 0. Define S to be of rank k if and only if for all pairs of distinct elements si, sj from S, <image>.

Given k and n, Dreamoon wants to make up n sets of rank k using integers from 1 to m such that no integer is used in two different sets (of course you can leave some integers without use). Calculate the minimum m that makes it possible and print one possible solution.

Input

The single line of the input contains two space separated integers n, k (1 ≤ n ≤ 10 000, 1 ≤ k ≤ 100).

Output

On the first line print a single integer — the minimal possible m.

On each of the next n lines print four space separated integers representing the i-th set.

Neither the order of the sets nor the order of integers within a set is important. If there are multiple possible solutions with minimal m, print any one of them.

Examples

Input

1 1

Output

5
1 2 3 5

Input

2 2

Output

22
2 4 6 22
14 18 10 16

Note

For the first example it's easy to see that set {1, 2, 3, 4} isn't a valid set of rank 1 since <image>.


The DNA sequence for every living creature in Berland can be represented as a non-empty line consisting of lowercase Latin letters. Berland scientists found out that all the creatures evolve by stages. During one stage exactly one symbol of the DNA line is replaced by exactly two other ones. At that overall there are n permissible substitutions. The substitution ai->bici means that any one symbol ai can be replaced with two symbols bici. Every substitution could happen an unlimited number of times.

They say that two creatures with DNA sequences s1 and s2 can have a common ancestor if there exists such a DNA sequence s3 that throughout evolution it can result in s1 and s2, perhaps after a different number of stages. Your task is to find out by the given s1 and s2 whether the creatures possessing such DNA sequences can have a common ancestor. If the answer is positive, you have to find the length of the shortest sequence of the common ancestor’s DNA.

Input

The first line contains a non-empty DNA sequence s1, the second line contains a non-empty DNA sequence s2. The lengths of these lines do not exceed 50, the lines contain only lowercase Latin letters. The third line contains an integer n (0 ≤ n ≤ 50) — the number of permissible substitutions. Then follow n lines each of which describes a substitution in the format ai->bici. The characters ai, bi, and ci are lowercase Latin letters. Lines s1 and s2 can coincide, the list of substitutions can contain similar substitutions.

Output

If s1 and s2 cannot have a common ancestor, print -1. Otherwise print the length of the shortest sequence s3, from which s1 and s2 could have evolved.

Examples

Input

ababa
aba
2
c->ba
c->cc

Output

2

Input

ababa
aba
7
c->ba
c->cc
e->ab
z->ea
b->ba
d->dd
d->ab

Output

1

Input

ababa
aba
1
c->ba

Output

-1


Polycarpus has a chessboard of size n × m, where k rooks are placed. Polycarpus hasn't yet invented the rules of the game he will play. However, he has already allocated q rectangular areas of special strategic importance on the board, they must be protected well. According to Polycarpus, a rectangular area of the board is well protected if all its vacant squares can be beaten by the rooks that stand on this area. The rooks on the rest of the board do not affect the area's defense. The position of the rooks is fixed and cannot be changed. We remind you that the the rook beats the squares located on the same vertical or horizontal line with it, if there are no other pieces between the square and the rook. Help Polycarpus determine whether all strategically important areas are protected.

Input

The first line contains four integers n, m, k and q (1 ≤ n, m ≤ 100 000, 1 ≤ k, q ≤ 200 000) — the sizes of the board, the number of rooks and the number of strategically important sites. We will consider that the cells of the board are numbered by integers from 1 to n horizontally and from 1 to m vertically. Next k lines contain pairs of integers "x y", describing the positions of the rooks (1 ≤ x ≤ n, 1 ≤ y ≤ m). It is guaranteed that all the rooks are in distinct squares. Next q lines describe the strategically important areas as groups of four integers "x1 y1 x2 y2" (1 ≤ x1 ≤ x2 ≤ n, 1 ≤ y1 ≤ y2 ≤ m). The corresponding rectangle area consists of cells (x, y), for which x1 ≤ x ≤ x2, y1 ≤ y ≤ y2. Strategically important areas can intersect of coincide.

Output

Print q lines. For each strategically important site print "YES" if it is well defended and "NO" otherwise.

Examples

Input

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

Output

YES
YES
NO

Note

Picture to the sample: <image> For the last area the answer is "NO", because cell (1, 2) cannot be hit by a rook.


One winter evening the Hedgehog was relaxing at home in his cozy armchair and clicking through the TV channels. Stumbled on an issue of «TopShop», the Hedgehog was about to change the channel when all of a sudden he was stopped by an advertisement of a new wondrous invention.

Actually, a vacuum cleaner was advertised there. It was called Marvellous Vacuum and it doesn't even need a human to operate it while it cleans! The vacuum cleaner can move around the flat on its own: it moves in some direction and if it hits an obstacle there, it automatically chooses a new direction. Sooner or later this vacuum cleaner will travel through all the room and clean it all. Having remembered how much time the Hedgehog spends every time on cleaning (surely, no less than a half of the day), he got eager to buy this wonder.

However, the Hedgehog quickly understood that the cleaner has at least one weak point: it won't clean well in the room's corners because it often won't able to reach the corner due to its shape. To estimate how serious is this drawback in practice, the Hedgehog asked you to write for him the corresponding program.

You will be given the cleaner's shape in the top view. We will consider only the cases when the vacuum cleaner is represented as a convex polygon. The room is some infinitely large rectangle. We consider one corner of this room and want to find such a rotation of the vacuum cleaner so that it, being pushed into this corner, will leave the minimum possible area in the corner uncovered.

Input

The first line contains an integer N which represents the number of vertices of the vacuum cleaner's polygon (3 ≤ N ≤ 4·104). Then follow N lines each containing two numbers — the coordinates of a vertex of the polygon. All the coordinates are integer and their absolute values do not exceed 106.

It is guaranteed that the given polygon is nondegenerate and convex (no three points lie on the same line). The polygon vertices are given in a clockwise or counter-clockwise direction.

Output

Print the minimum possible uncovered area. The answer will be accepted if it is within 10 - 6 of absolute or relative error from the correct answer.

Examples

Input

4
0 0
1 0
1 1
0 1

Output

0.00000000000000000000

Input

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

Output

0.50000000000000000000


Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains number i × j. The rows and columns are numbered starting from 1.

You are given a positive integer x. Your task is to count the number of cells in a table that contain number x.

Input

The single line contains numbers n and x (1 ≤ n ≤ 105, 1 ≤ x ≤ 109) — the size of the table and the number that we are looking for in the table.

Output

Print a single number: the number of times x occurs in the table.

Examples

Input

10 5

Output

2

Input

6 12

Output

4

Input

5 13

Output

0

Note

A table for the second sample test is given below. The occurrences of number 12 are marked bold.

<image>


Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all pairs of n and m, such that there are exactly x distinct squares in the table consisting of n rows and m columns. For example, in a 3 × 5 table there are 15 squares with side one, 8 squares with side two and 3 squares with side three. The total number of distinct squares in a 3 × 5 table is 15 + 8 + 3 = 26.

Input

The first line of the input contains a single integer x (1 ≤ x ≤ 1018) — the number of squares inside the tables Spongebob is interested in.

Output

First print a single integer k — the number of tables with exactly x distinct squares inside.

Then print k pairs of integers describing the tables. Print the pairs in the order of increasing n, and in case of equality — in the order of increasing m.

Examples

Input

26

Output

6
1 26
2 9
3 5
5 3
9 2
26 1

Input

2

Output

2
1 2
2 1

Input

8

Output

4
1 8
2 3
3 2
8 1

Note

In a 1 × 2 table there are 2 1 × 1 squares. So, 2 distinct squares in total.

<image>

In a 2 × 3 table there are 6 1 × 1 squares and 2 2 × 2 squares. That is equal to 8 squares in total.

<image>


There are n pearls in a row. Let's enumerate them with integers from 1 to n from the left to the right. The pearl number i has the type ai.

Let's call a sequence of consecutive pearls a segment. Let's call a segment good if it contains two pearls of the same type.

Split the row of the pearls to the maximal number of good segments. Note that each pearl should appear in exactly one segment of the partition.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use scanf/printf instead of cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.

Input

The first line contains integer n (1 ≤ n ≤ 3·105) — the number of pearls in a row.

The second line contains n integers ai (1 ≤ ai ≤ 109) – the type of the i-th pearl.

Output

On the first line print integer k — the maximal number of segments in a partition of the row.

Each of the next k lines should contain two integers lj, rj (1 ≤ lj ≤ rj ≤ n) — the number of the leftmost and the rightmost pearls in the j-th segment.

Note you should print the correct partition of the row of the pearls, so each pearl should be in exactly one segment and all segments should contain two pearls of the same type.

If there are several optimal solutions print any of them. You can print the segments in any order.

If there are no correct partitions of the row print the number "-1".

Examples

Input

5
1 2 3 4 1

Output

1
1 5

Input

5
1 2 3 4 5

Output

-1

Input

7
1 2 1 3 1 2 1

Output

2
1 3
4 7


Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it.

That element can store information about the matrix of integers size n × m. There are n + m inputs in that element, i.e. each row and each column can get the signal. When signal comes to the input corresponding to some row, this row cyclically shifts to the left, that is the first element of the row becomes last element, second element becomes first and so on. When signal comes to the input corresponding to some column, that column shifts cyclically to the top, that is first element of the column becomes last element, second element becomes first and so on. Rows are numbered with integers from 1 to n from top to bottom, while columns are numbered with integers from 1 to m from left to right.

Artem wants to carefully study this element before using it. For that purpose he is going to set up an experiment consisting of q turns. On each turn he either sends the signal to some input or checks what number is stored at some position of the matrix.

Artem has completed his experiment and has written down the results, but he has lost the chip! Help Artem find any initial matrix that will match the experiment results. It is guaranteed that experiment data is consistent, which means at least one valid matrix exists.

Input

The first line of the input contains three integers n, m and q (1 ≤ n, m ≤ 100, 1 ≤ q ≤ 10 000) — dimensions of the matrix and the number of turns in the experiment, respectively.

Next q lines contain turns descriptions, one per line. Each description starts with an integer ti (1 ≤ ti ≤ 3) that defines the type of the operation. For the operation of first and second type integer ri (1 ≤ ri ≤ n) or ci (1 ≤ ci ≤ m) follows, while for the operations of the third type three integers ri, ci and xi (1 ≤ ri ≤ n, 1 ≤ ci ≤ m,  - 109 ≤ xi ≤ 109) are given.

Operation of the first type (ti = 1) means that signal comes to the input corresponding to row ri, that is it will shift cyclically. Operation of the second type (ti = 2) means that column ci will shift cyclically. Finally, operation of the third type means that at this moment of time cell located in the row ri and column ci stores value xi.

Output

Print the description of any valid initial matrix as n lines containing m integers each. All output integers should not exceed 109 by their absolute value.

If there are multiple valid solutions, output any of them.

Examples

Input

2 2 6
2 1
2 2
3 1 1 1
3 2 2 2
3 1 2 8
3 2 1 8

Output

8 2
1 8

Input

3 3 2
1 2
3 2 2 5

Output

0 0 0
0 0 5
0 0 0


Little Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are with computer science. He wants to apply this time machine to a well-known data structure: multiset.

Artem wants to create a basic multiset of integers. He wants these structure to support operations of three types:

  1. Add integer to the multiset. Note that the difference between set and multiset is that multiset may store several instances of one integer.
  2. Remove integer from the multiset. Only one instance of this integer is removed. Artem doesn't want to handle any exceptions, so he assumes that every time remove operation is called, that integer is presented in the multiset.
  3. Count the number of instances of the given integer that are stored in the multiset.

But what about time machine? Artem doesn't simply apply operations to the multiset one by one, he now travels to different moments of time and apply his operation there. Consider the following example.

  * First Artem adds integer 5 to the multiset at the 1-st moment of time.
  * Then Artem adds integer 3 to the multiset at the moment 5.
  * Then Artem asks how many 5 are there in the multiset at moment 6. The answer is 1.
  * Then Artem returns back in time and asks how many integers 3 are there in the set at moment 4. Since 3 was added only at moment 5, the number of integers 3 at moment 4 equals to 0.
  * Then Artem goes back in time again and removes 5 from the multiset at moment 3.
  * Finally Artyom asks at moment 7 how many integers 5 are there in the set. The result is 0, since we have removed 5 at the moment 3.

Note that Artem dislikes exceptions so much that he assures that after each change he makes all delete operations are applied only to element that is present in the multiset. The answer to the query of the third type is computed at the moment Artem makes the corresponding query and are not affected in any way by future changes he makes.

Help Artem implement time travellers multiset.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of Artem's queries.

Then follow n lines with queries descriptions. Each of them contains three integers ai, ti and xi (1 ≤ ai ≤ 3, 1 ≤ ti, xi ≤ 109) — type of the query, moment of time Artem travels to in order to execute this query and the value of the query itself, respectively. It's guaranteed that all moments of time are distinct and that after each operation is applied all operations of the first and second types are consistent.

Output

For each ask operation output the number of instances of integer being queried at the given moment of time.

Examples

Input

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

Output

1
2
1

Input

3
1 1 1
2 2 1
3 3 1

Output

0


Zombies seem to have become much more intelligent lately – a few have somehow wandered into the base through the automatic gate. Heidi has had to beef up security, and a new gate has been installed. Unfortunately, now the questions being asked are more complicated, and even humans have trouble answering them. Can you still program the robot army to do this reliably?

The new questions are of the following form: a grayscale photograph has been divided into several horizontal pieces, which have been arbitrarily rearranged. The task is to assemble the original image back from these pieces (somewhat like in a jigsaw puzzle). To further delay the zombies, significant Gaussian-distributed noise has been added to the image.

Input

The input format is the same as in the previous version, except that the first line of every question now contains three space-separated numbers h, w and k (1 ≤ h, w ≤ 600, 2 ≤ k ≤ 16) – the height (number of rows) and width (number of columns) of the photograph and the number of pieces, respectively. The number of pieces evenly divides the height, and each piece is of the same height h / k.

Again, there is only one input file to be processed, and the same resources are provided to you as in the previous version (except that now you are given all input images in .bmp format, rather than the first 50).

Output

Your program should print q lines. The i-th line should contain your answer for the i-th question: a space-separated sequence of k numbers π1, π2, ..., πk such that:

  * π is a permutation of {1, 2, ..., k}, that is, each number from 1 to k appears exactly once in π,
  * for each j = 1, ..., k, πj is the position (index), in the original image, of the piece which is at position j in the input image. (See the illustration below for clarity.)

<image>

The second image from the test set. If the three pieces in the original image are numbered 1, 2, 3 from top to bottom, then the numbering in the image on the right should be 2, 3, 1. The correct answer for this image is thus 2 3 1.

Again, your answers will be accepted if they conform to this format and if at least 75% of them are correct.

Again, you may process the input locally and submit just your precomputed answers (i.e., a program which just prints your output for the input file all.in).

Note

The link to download all the necessary materials is http://assets.codeforces.com/files/690/medium_contestant_package.zip


ZS the Coder has drawn an undirected graph of n vertices numbered from 0 to n - 1 and m edges between them. Each edge of the graph is weighted, each weight is a positive integer.

The next day, ZS the Coder realized that some of the weights were erased! So he wants to reassign positive integer weight to each of the edges which weights were erased, so that the length of the shortest path between vertices s and t in the resulting graph is exactly L. Can you help him?

Input

The first line contains five integers n, m, L, s, t (2 ≤ n ≤ 1000, 1 ≤ m ≤ 10 000, 1 ≤ L ≤ 109, 0 ≤ s, t ≤ n - 1, s ≠ t) — the number of vertices, number of edges, the desired length of shortest path, starting vertex and ending vertex respectively.

Then, m lines describing the edges of the graph follow. i-th of them contains three integers, ui, vi, wi (0 ≤ ui, vi ≤ n - 1, ui ≠ vi, 0 ≤ wi ≤ 109). ui and vi denote the endpoints of the edge and wi denotes its weight. If wi is equal to 0 then the weight of the corresponding edge was erased.

It is guaranteed that there is at most one edge between any pair of vertices.

Output

Print "NO" (without quotes) in the only line if it's not possible to assign the weights in a required way.

Otherwise, print "YES" in the first line. Next m lines should contain the edges of the resulting graph, with weights assigned to edges which weights were erased. i-th of them should contain three integers ui, vi and wi, denoting an edge between vertices ui and vi of weight wi. The edges of the new graph must coincide with the ones in the graph from the input. The weights that were not erased must remain unchanged whereas the new weights can be any positive integer not exceeding 1018.

The order of the edges in the output doesn't matter. The length of the shortest path between s and t must be equal to L.

If there are multiple solutions, print any of them.

Examples

Input

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

Output

YES
0 1 5
2 1 2
3 2 3
1 4 8
4 3 4

Input

2 1 123456789 0 1
0 1 0

Output

YES
0 1 123456789

Input

2 1 999999999 1 0
0 1 1000000000

Output

NO

Note

Here's how the graph in the first sample case looks like :

<image>

In the first sample case, there is only one missing edge weight. Placing the weight of 8 gives a shortest path from 0 to 4 of length 13.

In the second sample case, there is only a single edge. Clearly, the only way is to replace the missing weight with 123456789.

In the last sample case, there is no weights to assign but the length of the shortest path doesn't match the required value, so the answer is "NO".


Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and the amount of tax he has to pay is calculated as the maximum divisor of n (not equal to n, of course). For example, if n = 6 then Funt has to pay 3 burles, while for n = 25 he needs to pay 5 and if n = 2 he pays only 1 burle.

As mr. Funt is a very opportunistic person he wants to cheat a bit. In particular, he wants to split the initial n in several parts n1 + n2 + ... + nk = n (here k is arbitrary, even k = 1 is allowed) and pay the taxes for each part separately. He can't make some part equal to 1 because it will reveal him. So, the condition ni ≥ 2 should hold for all i from 1 to k.

Ostap Bender wonders, how many money Funt has to pay (i.e. minimal) if he chooses and optimal way to split n in parts.

Input

The first line of the input contains a single integer n (2 ≤ n ≤ 2·109) — the total year income of mr. Funt.

Output

Print one integer — minimum possible number of burles that mr. Funt has to pay as a tax.

Examples

Input

4

Output

2

Input

27

Output

3


Ahmed and Mostafa used to compete together in many programming contests for several years. Their coach Fegla asked them to solve one challenging problem, of course Ahmed was able to solve it but Mostafa couldn't.

This problem is similar to a standard problem but it has a different format and constraints.

In the standard problem you are given an array of integers, and you have to find one or more consecutive elements in this array where their sum is the maximum possible sum.

But in this problem you are given n small arrays, and you will create one big array from the concatenation of one or more instances of the small arrays (each small array could occur more than once). The big array will be given as an array of indexes (1-based) of the small arrays, and the concatenation should be done in the same order as in this array. Then you should apply the standard problem mentioned above on the resulting big array.

For example let's suppose that the small arrays are {1, 6, -2}, {3, 3} and {-5, 1}. And the indexes in the big array are {2, 3, 1, 3}. So the actual values in the big array after formatting it as concatenation of the small arrays will be {3, 3, -5, 1, 1, 6, -2, -5, 1}. In this example the maximum sum is 9.

Can you help Mostafa solve this problem?

Input

The first line contains two integers n and m, n is the number of the small arrays (1 ≤ n ≤ 50), and m is the number of indexes in the big array (1 ≤ m ≤ 250000). Then follow n lines, the i-th line starts with one integer l which is the size of the i-th array (1 ≤ l ≤ 5000), followed by l integers each one will be greater than or equal -1000 and less than or equal 1000. The last line contains m integers which are the indexes in the big array, and you should concatenate the small arrays in the same order, and each index will be greater than or equal to 1 and less than or equal to n.

The small arrays are numbered from 1 to n in the same order as given in the input. Some of the given small arrays may not be used in big array.

Note, that the array is very big. So if you try to build it straightforwardly, you will probably get time or/and memory limit exceeded.

Output

Print one line containing the maximum sum in the big array after formatting it as described above. You must choose at least one element for the sum, i. e. it cannot be empty.

Please, do not use %lld specificator to write 64-bit integers in C++. It is preferred to use cout (also you may use %I64d).

Examples

Input

3 4
3 1 6 -2
2 3 3
2 -5 1
2 3 1 3

Output

9

Input

6 1
4 0 8 -3 -10
8 3 -2 -5 10 8 -9 -5 -4
1 0
1 -3
3 -8 5 6
2 9 6
1

Output

8


Andryusha goes through a park each day. The squares and paths between them look boring to Andryusha, so he decided to decorate them.

The park consists of n squares connected with (n - 1) bidirectional paths in such a way that any square is reachable from any other using these paths. Andryusha decided to hang a colored balloon at each of the squares. The baloons' colors are described by positive integers, starting from 1. In order to make the park varicolored, Andryusha wants to choose the colors in a special way. More precisely, he wants to use such colors that if a, b and c are distinct squares that a and b have a direct path between them, and b and c have a direct path between them, then balloon colors on these three squares are distinct.

Andryusha wants to use as little different colors as possible. Help him to choose the colors!

Input

The first line contains single integer n (3 ≤ n ≤ 2·105) — the number of squares in the park.

Each of the next (n - 1) lines contains two integers x and y (1 ≤ x, y ≤ n) — the indices of two squares directly connected by a path.

It is guaranteed that any square is reachable from any other using the paths.

Output

In the first line print single integer k — the minimum number of colors Andryusha has to use.

In the second line print n integers, the i-th of them should be equal to the balloon color on the i-th square. Each of these numbers should be within range from 1 to k.

Examples

Input

3
2 3
1 3

Output

3
1 3 2

Input

5
2 3
5 3
4 3
1 3

Output

5
1 3 2 5 4

Input

5
2 1
3 2
4 3
5 4

Output

3
1 2 3 1 2

Note

In the first sample the park consists of three squares: 1 → 3 → 2. Thus, the balloon colors have to be distinct.

<image> Illustration for the first sample.

In the second example there are following triples of consequently connected squares:

  * 1 → 3 → 2
  * 1 → 3 → 4
  * 1 → 3 → 5
  * 2 → 3 → 4
  * 2 → 3 → 5
  * 4 → 3 → 5

We can see that each pair of squares is encountered in some triple, so all colors have to be distinct. <image> Illustration for the second sample.

In the third example there are following triples:

  * 1 → 2 → 3
  * 2 → 3 → 4
  * 3 → 4 → 5

We can see that one or two colors is not enough, but there is an answer that uses three colors only. <image> Illustration for the third sample.


You are given an array a consisting of positive integers and q queries to this array. There are two types of queries:

  * 1 l r x — for each index i such that l ≤ i ≤ r set ai = x.
  * 2 l r — find the minimum among such ai that l ≤ i ≤ r.

We decided that this problem is too easy. So the array a is given in a compressed form: there is an array b consisting of n elements and a number k in the input, and before all queries a is equal to the concatenation of k arrays b (so the size of a is n·k).

Input

The first line contains two integers n and k (1 ≤ n ≤ 105, 1 ≤ k ≤ 104).

The second line contains n integers — elements of the array b (1 ≤ bi ≤ 109).

The third line contains one integer q (1 ≤ q ≤ 105).

Then q lines follow, each representing a query. Each query is given either as 1 l r x — set all elements in the segment from l till r (including borders) to x (1 ≤ l ≤ r ≤ n·k, 1 ≤ x ≤ 109) or as 2 l r — find the minimum among all elements in the segment from l till r (1 ≤ l ≤ r ≤ n·k).

Output

For each query of type 2 print the answer to this query — the minimum on the corresponding segment.

Examples

Input

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

Output

1
3

Input

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

Output

1
5
1


Everyone knows that DNA strands consist of nucleotides. There are four types of nucleotides: "A", "T", "G", "C". A DNA strand is a sequence of nucleotides. Scientists decided to track evolution of a rare species, which DNA strand was string s initially.

Evolution of the species is described as a sequence of changes in the DNA. Every change is a change of some nucleotide, for example, the following change can happen in DNA strand "AAGC": the second nucleotide can change to "T" so that the resulting DNA strand is "ATGC".

Scientists know that some segments of the DNA strand can be affected by some unknown infections. They can represent an infection as a sequence of nucleotides. Scientists are interested if there are any changes caused by some infections. Thus they sometimes want to know the value of impact of some infection to some segment of the DNA. This value is computed as follows:

  * Let the infection be represented as a string e, and let scientists be interested in DNA strand segment starting from position l to position r, inclusive.
  * Prefix of the string eee... (i.e. the string that consists of infinitely many repeats of string e) is written under the string s from position l to position r, inclusive.
  * The value of impact is the number of positions where letter of string s coincided with the letter written under it.

Being a developer, Innokenty is interested in bioinformatics also, so the scientists asked him for help. Innokenty is busy preparing VK Cup, so he decided to delegate the problem to the competitors. Help the scientists!

Input

The first line contains the string s (1 ≤ |s| ≤ 105) that describes the initial DNA strand. It consists only of capital English letters "A", "T", "G" and "C".

The next line contains single integer q (1 ≤ q ≤ 105) — the number of events.

After that, q lines follow, each describes one event. Each of the lines has one of two formats:

  * 1 x c, where x is an integer (1 ≤ x ≤ |s|), and c is a letter "A", "T", "G" or "C", which means that there is a change in the DNA: the nucleotide at position x is now c.
  * 2 l r e, where l, r are integers (1 ≤ l ≤ r ≤ |s|), and e is a string of letters "A", "T", "G" and "C" (1 ≤ |e| ≤ 10), which means that scientists are interested in the value of impact of infection e to the segment of DNA strand from position l to position r, inclusive.

Output

For each scientists' query (second type query) print a single integer in a new line — the value of impact of the infection on the DNA.

Examples

Input

ATGCATGC
4
2 1 8 ATGC
2 2 6 TTT
1 4 T
2 2 6 TA

Output

8
2
4

Input

GAGTTGTTAA
6
2 3 4 TATGGTG
1 1 T
1 6 G
2 5 9 AGTAATA
1 10 G
2 2 6 TTGT

Output

0
3
1

Note

Consider the first example. In the first query of second type all characters coincide, so the answer is 8. In the second query we compare string "TTTTT..." and the substring "TGCAT". There are two matches. In the third query, after the DNA change, we compare string "TATAT..."' with substring "TGTAT". There are 4 matches.


You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.

We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vectors <image> and <image> is acute (i.e. strictly less than <image>). Otherwise, the point is called good.

The angle between vectors <image> and <image> in 5-dimensional space is defined as <image>, where <image> is the scalar product and <image> is length of <image>.

Given the list of points, print the indices of the good points in ascending order.

Input

The first line of input contains a single integer n (1 ≤ n ≤ 103) — the number of points.

The next n lines of input contain five integers ai, bi, ci, di, ei (|ai|, |bi|, |ci|, |di|, |ei| ≤ 103) — the coordinates of the i-th point. All points are distinct.

Output

First, print a single integer k — the number of good points.

Then, print k integers, each on their own line — the indices of the good points in ascending order.

Examples

Input

6
0 0 0 0 0
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1

Output

1
1

Input

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

Output

0

Note

In the first sample, the first point forms exactly a <image> angle with all other pairs of points, so it is good.

In the second sample, along the cd plane, we can see the points look as follows:

<image>

We can see that all angles here are acute, so no points are good.


Ivan is playing a strange game.

He has a matrix a with n rows and m columns. Each element of the matrix is equal to either 0 or 1. Rows and columns are 1-indexed. Ivan can replace any number of ones in this matrix with zeroes. After that, his score in the game will be calculated as follows:

  1. Initially Ivan's score is 0;
  2. In each column, Ivan will find the topmost 1 (that is, if the current column is j, then he will find minimum i such that ai, j = 1). If there are no 1's in the column, this column is skipped;
  3. Ivan will look at the next min(k, n - i + 1) elements in this column (starting from the element he found) and count the number of 1's among these elements. This number will be added to his score.

Of course, Ivan wants to maximize his score in this strange game. Also he doesn't want to change many elements, so he will replace the minimum possible number of ones with zeroes. Help him to determine the maximum possible score he can get and the minimum possible number of replacements required to achieve that score.

Input

The first line contains three integer numbers n, m and k (1 ≤ k ≤ n ≤ 100, 1 ≤ m ≤ 100).

Then n lines follow, i-th of them contains m integer numbers — the elements of i-th row of matrix a. Each number is either 0 or 1.

Output

Print two numbers: the maximum possible score Ivan can get and the minimum number of replacements required to get this score.

Examples

Input

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

Output

4 1

Input

3 2 1
1 0
0 1
0 0

Output

2 0

Note

In the first example Ivan will replace the element a1, 2.