There is a forest that we model as a plane and live $n$ rare animals. Animal number $i$ has its lair in the point $(x_{i}, y_{i})$. In order to protect them, a decision to build a nature reserve has been made.

The reserve must have a form of a circle containing all lairs. There is also a straight river flowing through the forest. All animals drink from this river, therefore it must have at least one common point with the reserve. On the other hand, ships constantly sail along the river, so the reserve must not have more than one common point with the river.

For convenience, scientists have made a transformation of coordinates so that the river is defined by $y = 0$. Check whether it is possible to build a reserve, and if possible, find the minimum possible radius of such a reserve.

-----Input-----

The first line contains one integer $n$ ($1 \le n \le 10^5$) — the number of animals.

Each of the next $n$ lines contains two integers $x_{i}$, $y_{i}$ ($-10^7 \le x_{i}, y_{i} \le 10^7$) — the coordinates of the $i$-th animal's lair. It is guaranteed that $y_{i} \neq 0$. No two lairs coincide.

-----Output-----

If the reserve cannot be built, print $-1$. Otherwise print the minimum radius. Your answer will be accepted if absolute or relative error does not exceed $10^{-6}$.

Formally, let your answer be $a$, and the jury's answer be $b$. Your answer is considered correct if $\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-6}$.

-----Examples-----
Input
1
0 1

Output
0.5
Input
3
0 1
0 2
0 -3

Output
-1

Input
2
0 1
1 1

Output
0.625

-----Note-----

In the first sample it is optimal to build the reserve with the radius equal to $0.5$ and the center in $(0,\ 0.5)$.

In the second sample it is impossible to build a reserve.

In the third sample it is optimal to build the reserve with the radius equal to $\frac{5}{8}$ and the center in $(\frac{1}{2},\ \frac{5}{8})$.


At the big break Nastya came to the school dining room. There are $n$ pupils in the school, numbered from $1$ to $n$. Unfortunately, Nastya came pretty late, so that all pupils had already stood in the queue, i.e. Nastya took the last place in the queue. Of course, it's a little bit sad for Nastya, but she is not going to despond because some pupils in the queue can agree to change places with some other pupils.

Formally, there are some pairs $u$, $v$ such that if the pupil with number $u$ stands directly in front of the pupil with number $v$, Nastya can ask them and they will change places.

Nastya asks you to find the maximal number of places in queue she can move forward.

-----Input-----

The first line contains two integers $n$ and $m$ ($1 \leq n \leq 3 \cdot 10^{5}$, $0 \leq m \leq 5 \cdot 10^{5}$) — the number of pupils in the queue and number of pairs of pupils such that the first one agrees to change places with the second one if the first is directly in front of the second.

The second line contains $n$ integers $p_1$, $p_2$, ..., $p_n$ — the initial arrangement of pupils in the queue, from the queue start to its end ($1 \leq p_i \leq n$, $p$ is a permutation of integers from $1$ to $n$). In other words, $p_i$ is the number of the pupil who stands on the $i$-th position in the queue.

The $i$-th of the following $m$ lines contains two integers $u_i$, $v_i$ ($1 \leq u_i, v_i \leq n, u_i \neq v_i$), denoting that the pupil with number $u_i$ agrees to change places with the pupil with number $v_i$ if $u_i$ is directly in front of $v_i$. It is guaranteed that if $i \neq j$, than $v_i \neq v_j$ or $u_i \neq u_j$. Note that it is possible that in some pairs both pupils agree to change places with each other.

Nastya is the last person in the queue, i.e. the pupil with number $p_n$.

-----Output-----

Print a single integer — the number of places in queue she can move forward.

-----Examples-----
Input
2 1
1 2
1 2

Output
1
Input
3 3
3 1 2
1 2
3 1
3 2

Output
2
Input
5 2
3 1 5 4 2
5 2
5 4

Output
1

-----Note-----

In the first example Nastya can just change places with the first pupil in the queue.

Optimal sequence of changes in the second example is   change places for pupils with numbers $1$ and $3$.  change places for pupils with numbers $3$ and $2$.  change places for pupils with numbers $1$ and $2$.

The queue looks like $[3, 1, 2]$, then $[1, 3, 2]$, then $[1, 2, 3]$, and finally $[2, 1, 3]$ after these operations.


Dima liked the present he got from Inna very much. He liked the present he got from Seryozha even more.

Dima felt so grateful to Inna about the present that he decided to buy her n hares. Inna was very happy. She lined up the hares in a row, numbered them from 1 to n from left to right and started feeding them with carrots. Inna was determined to feed each hare exactly once. But in what order should she feed them?

Inna noticed that each hare radiates joy when she feeds it. And the joy of the specific hare depends on whether Inna fed its adjacent hares before feeding it. Inna knows how much joy a hare radiates if it eats when either both of his adjacent hares are hungry, or one of the adjacent hares is full (that is, has been fed), or both of the adjacent hares are full. Please note that hares number 1 and n don't have a left and a right-adjacent hare correspondingly, so they can never have two full adjacent hares.

Help Inna maximize the total joy the hares radiate. :)

-----Input-----

The first line of the input contains integer n (1 ≤ n ≤ 3000) — the number of hares. Then three lines follow, each line has n integers. The first line contains integers a_1 a_2 ... a_{n}. The second line contains b_1, b_2, ..., b_{n}. The third line contains c_1, c_2, ..., c_{n}. The following limits are fulfilled: 0 ≤ a_{i}, b_{i}, c_{i} ≤ 10^5.

Number a_{i} in the first line shows the joy that hare number i gets if his adjacent hares are both hungry. Number b_{i} in the second line shows the joy that hare number i radiates if he has exactly one full adjacent hare. Number с_{i} in the third line shows the joy that hare number i radiates if both his adjacent hares are full.

-----Output-----

In a single line, print the maximum possible total joy of the hares Inna can get by feeding them.

-----Examples-----
Input
4
1 2 3 4
4 3 2 1
0 1 1 0

Output
13

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

Output
44

Input
3
1 1 1
1 2 1
1 1 1

Output
4


The only difference between easy and hard versions is constraints.

If you write a solution in Python, then prefer to send it in PyPy to speed up execution time.

A session has begun at Beland State University. Many students are taking exams.

Polygraph Poligrafovich is going to examine a group of $n$ students. Students will take the exam one-by-one in order from $1$-th to $n$-th. Rules of the exam are following:  The $i$-th student randomly chooses a ticket.  if this ticket is too hard to the student, he doesn't answer and goes home immediately (this process is so fast that it's considered no time elapses). This student fails the exam.  if the student finds the ticket easy, he spends exactly $t_i$ minutes to pass the exam. After it, he immediately gets a mark and goes home.

Students take the exam in the fixed order, one-by-one, without any interruption. At any moment of time, Polygraph Poligrafovich takes the answer from one student.

The duration of the whole exam for all students is $M$ minutes ($\max t_i \le M$), so students at the end of the list have a greater possibility to run out of time to pass the exam.

For each student $i$, you should count the minimum possible number of students who need to fail the exam so the $i$-th student has enough time to pass the exam.

For each student $i$, find the answer independently. That is, if when finding the answer for the student $i_1$ some student $j$ should leave, then while finding the answer for $i_2$ ($i_2>i_1$) the student $j$ student does not have to go home.

-----Input-----

The first line of the input contains two integers $n$ and $M$ ($1 \le n \le 2 \cdot 10^5$, $1 \le M \le 2 \cdot 10^7$) — the number of students and the total duration of the exam in minutes, respectively.

The second line of the input contains $n$ integers $t_i$ ($1 \le t_i \le 100$) — time in minutes that $i$-th student spends to answer to a ticket.

It's guaranteed that all values of $t_i$ are not greater than $M$.

-----Output-----

Print $n$ numbers: the $i$-th number must be equal to the minimum number of students who have to leave the exam in order to $i$-th student has enough time to pass the exam.

-----Examples-----
Input
7 15
1 2 3 4 5 6 7

Output
0 0 0 0 0 2 3
Input
5 100
80 40 40 40 60

Output
0 1 1 2 3

-----Note-----

The explanation for the example 1.

Please note that the sum of the first five exam times does not exceed $M=15$ (the sum is $1+2+3+4+5=15$). Thus, the first five students can pass the exam even if all the students before them also pass the exam. In other words, the first five numbers in the answer are $0$.

In order for the $6$-th student to pass the exam, it is necessary that at least $2$ students must fail it before (for example, the $3$-rd and $4$-th, then the $6$-th will finish its exam in $1+2+5+6=14$ minutes, which does not exceed $M$).

In order for the $7$-th student to pass the exam, it is necessary that at least $3$ students must fail it before (for example, the $2$-nd, $5$-th and $6$-th, then the $7$-th will finish its exam in $1+3+4+7=15$ minutes, which does not exceed $M$).


On a certain meeting of a ruling party "A" minister Pavel suggested to improve the sewer system and to create a new pipe in the city.

The city is an n × m rectangular squared field. Each square of the field is either empty (then the pipe can go in it), or occupied (the pipe cannot go in such square). Empty squares are denoted by character '.', occupied squares are denoted by character '#'.

The pipe must meet the following criteria:  the pipe is a polyline of width 1,  the pipe goes in empty squares,  the pipe starts from the edge of the field, but not from a corner square,  the pipe ends at the edge of the field but not in a corner square,  the pipe has at most 2 turns (90 degrees),  the border squares of the field must share exactly two squares with the pipe,  if the pipe looks like a single segment, then the end points of the pipe must lie on distinct edges of the field,  for each non-border square of the pipe there are exacly two side-adjacent squares that also belong to the pipe,  for each border square of the pipe there is exactly one side-adjacent cell that also belongs to the pipe.

Here are some samples of allowed piping routes:

           ....#            ....#            .*..#

           *****            ****.            .***.

           ..#..            ..#*.            ..#*.

           #...#            #..*#            #..*#

           .....            ...*.            ...*.

Here are some samples of forbidden piping routes:

           .**.#            *...#            .*.*#

           .....            ****.            .*.*.

           ..#..            ..#*.            .*#*.

           #...#            #..*#            #*.*#

           .....            ...*.            .***.

In these samples the pipes are represented by characters ' * '.

You were asked to write a program that calculates the number of distinct ways to make exactly one pipe in the city.

The two ways to make a pipe are considered distinct if they are distinct in at least one square.

-----Input-----

The first line of the input contains two integers n, m (2 ≤ n, m ≤ 2000) — the height and width of Berland map.

Each of the next n lines contains m characters — the map of the city.

If the square of the map is marked by character '.', then the square is empty and the pipe can through it.

If the square of the map is marked by character '#', then the square is full and the pipe can't through it.

-----Output-----

In the first line of the output print a single integer — the number of distinct ways to create a pipe.

-----Examples-----
Input
3 3
...
..#
...

Output
3
Input
4 2
..
..
..
..

Output
2

Input
4 5
#...#
#...#
###.#
###.#

Output
4

-----Note-----

In the first sample there are 3 ways to make a pipe (the squares of the pipe are marked by characters ' * '):

       .*.        .*.        ...

       .*#        **#        **#

       .*.        ...        .*.


Consider a rooted tree. A rooted tree has one special vertex called the root. All edges are directed from the root. Vertex u is called a child of vertex v and vertex v is called a parent of vertex u if there exists a directed edge from v to u. A vertex is called a leaf if it doesn't have children and has a parent.

Let's call a rooted tree a spruce if its every non-leaf vertex has at least 3 leaf children. You are given a rooted tree, check whether it's a spruce.

The definition of a rooted tree can be found here.

-----Input-----

The first line contains one integer n — the number of vertices in the tree (3 ≤ n ≤ 1 000). Each of the next n - 1 lines contains one integer p_{i} (1 ≤ i ≤ n - 1) — the index of the parent of the i + 1-th vertex (1 ≤ p_{i} ≤ i).

Vertex 1 is the root. It's guaranteed that the root has at least 2 children.

-----Output-----

Print "Yes" if the tree is a spruce and "No" otherwise.

-----Examples-----
Input
4
1
1
1

Output
Yes

Input
7
1
1
1
2
2
2

Output
No

Input
8
1
1
1
1
3
3
3

Output
Yes

-----Note-----

The first example:

[Image]

The second example:

$8$

It is not a spruce, because the non-leaf vertex 1 has only 2 leaf children.

The third example:

[Image]


The array a with n integers is given. Let's call the sequence of one or more consecutive elements in a segment. Also let's call the segment k-good if it contains no more than k different values.

Find any longest k-good segment.

As the 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 two integers n, k (1 ≤ k ≤ n ≤ 5·10^5) — the number of elements in a and the parameter k.

The second line contains n integers a_{i} (0 ≤ a_{i} ≤ 10^6) — the elements of the array a.

-----Output-----

Print two integers l, r (1 ≤ l ≤ r ≤ n) — the index of the left and the index of the right ends of some k-good longest segment. If there are several longest segments you can print any of them. The elements in a are numbered from 1 to n from left to right.

-----Examples-----
Input
5 5
1 2 3 4 5

Output
1 5

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

Output
3 7

Input
3 1
1 2 3

Output
1 1


Alice likes snow a lot! Unfortunately, this year's winter is already over, and she can't expect to have any more of it. Bob has thus bought her a gift — a large snow maker. He plans to make some amount of snow every day. On day i he will make a pile of snow of volume V_{i} and put it in her garden.

Each day, every pile will shrink a little due to melting. More precisely, when the temperature on a given day is T_{i}, each pile will reduce its volume by T_{i}. If this would reduce the volume of a pile to or below zero, it disappears forever. All snow piles are independent of each other.

Note that the pile made on day i already loses part of its volume on the same day. In an extreme case, this may mean that there are no piles left at the end of a particular day.

You are given the initial pile sizes and the temperature on each day. Determine the total volume of snow melted on each day.

-----Input-----

The first line contains a single integer N (1 ≤ N ≤ 10^5) — the number of days.

The second line contains N integers V_1, V_2, ..., V_{N} (0 ≤ V_{i} ≤ 10^9), where V_{i} is the initial size of a snow pile made on the day i.

The third line contains N integers T_1, T_2, ..., T_{N} (0 ≤ T_{i} ≤ 10^9), where T_{i} is the temperature on the day i.

-----Output-----

Output a single line with N integers, where the i-th integer represents the total volume of snow melted on day i.

-----Examples-----
Input
3
10 10 5
5 7 2

Output
5 12 4

Input
5
30 25 20 15 10
9 10 12 4 13

Output
9 20 35 11 25

-----Note-----

In the first sample, Bob first makes a snow pile of volume 10, which melts to the size of 5 on the same day. On the second day, he makes another pile of size 10. Since it is a bit warmer than the day before, the first pile disappears completely while the second pile shrinks to 3. At the end of the second day, he has only a single pile of size 3. On the third day he makes a smaller pile than usual, but as the temperature dropped too, both piles survive till the end of the day.


Vasya has a sequence of cubes and exactly one integer is written on each cube. Vasya exhibited all his cubes in a row. So the sequence of numbers written on the cubes in the order from the left to the right equals to a_1, a_2, ..., a_{n}.

While Vasya was walking, his little brother Stepan played with Vasya's cubes and changed their order, so now the sequence of numbers written on the cubes became equal to b_1, b_2, ..., b_{n}.

Stepan said that he swapped only cubes which where on the positions between l and r, inclusive, and did not remove or add any other cubes (i. e. he said that he reordered cubes between positions l and r, inclusive, in some way).

Your task is to determine if it is possible that Stepan said the truth, or it is guaranteed that Stepan deceived his brother.

-----Input-----

The first line contains three integers n, l, r (1 ≤ n ≤ 10^5, 1 ≤ l ≤ r ≤ n) — the number of Vasya's cubes and the positions told by Stepan.

The second line contains the sequence a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ n) — the sequence of integers written on cubes in the Vasya's order.

The third line contains the sequence b_1, b_2, ..., b_{n} (1 ≤ b_{i} ≤ n) — the sequence of integers written on cubes after Stepan rearranged their order.

It is guaranteed that Stepan did not remove or add other cubes, he only rearranged Vasya's cubes.

-----Output-----

Print "LIE" (without quotes) if it is guaranteed that Stepan deceived his brother. In the other case, print "TRUTH" (without quotes).

-----Examples-----
Input
5 2 4
3 4 2 3 1
3 2 3 4 1

Output
TRUTH

Input
3 1 2
1 2 3
3 1 2

Output
LIE

Input
4 2 4
1 1 1 1
1 1 1 1

Output
TRUTH

-----Note-----

In the first example there is a situation when Stepan said the truth. Initially the sequence of integers on the cubes was equal to [3, 4, 2, 3, 1]. Stepan could at first swap cubes on positions 2 and 3 (after that the sequence of integers on cubes became equal to [3, 2, 4, 3, 1]), and then swap cubes in positions 3 and 4 (after that the sequence of integers on cubes became equal to [3, 2, 3, 4, 1]).

In the second example it is not possible that Stepan said truth because he said that he swapped cubes only between positions 1 and 2, but we can see that it is guaranteed that he changed the position of the cube which was on the position 3 at first. So it is guaranteed that Stepan deceived his brother.

In the third example for any values l and r there is a situation when Stepan said the truth.


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·10^5) — 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.


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

Consider a permutation $p$ of length $n$, we build a graph of size $n$ using it as follows:   For every $1 \leq i \leq n$, find the largest $j$ such that $1 \leq j < i$ and $p_j > p_i$, and add an undirected edge between node $i$ and node $j$  For every $1 \leq i \leq n$, find the smallest $j$ such that $i < j \leq n$ and $p_j > p_i$, and add an undirected edge between node $i$ and node $j$

In cases where no such $j$ exists, we make no edges. Also, note that we make edges between the corresponding indices, not the values at those indices.

For clarity, consider as an example $n = 4$, and $p = [3,1,4,2]$; here, the edges of the graph are $(1,3),(2,1),(2,3),(4,3)$.

A permutation $p$ is cyclic if the graph built using $p$ has at least one simple cycle.

Given $n$, find the number of cyclic permutations of length $n$. Since the number may be very large, output it modulo $10^9+7$.

Please refer to the Notes section for the formal definition of a simple cycle

-----Input-----

The first and only line contains a single integer $n$ ($3 \le n \le 10^6$).

-----Output-----

Output a single integer $0 \leq x < 10^9+7$, the number of cyclic permutations of length $n$ modulo $10^9+7$.

-----Examples-----
Input
4

Output
16
Input
583291

Output
135712853

-----Note-----

There are $16$ cyclic permutations for $n = 4$. $[4,2,1,3]$ is one such permutation, having a cycle of length four: $4 \rightarrow 3 \rightarrow 2 \rightarrow 1 \rightarrow 4$.

Nodes $v_1$, $v_2$, $\ldots$, $v_k$ form a simple cycle if the following conditions hold:   $k \geq 3$.  $v_i \neq v_j$ for any pair of indices $i$ and $j$. ($1 \leq i < j \leq k$)  $v_i$ and $v_{i+1}$ share an edge for all $i$ ($1 \leq i < k$), and $v_1$ and $v_k$ share an edge.


Cowboy Vlad has a birthday today! There are $n$ children who came to the celebration. In order to greet Vlad, the children decided to form a circle around him. Among the children who came, there are both tall and low, so if they stand in a circle arbitrarily, it may turn out, that there is a tall and low child standing next to each other, and it will be difficult for them to hold hands. Therefore, children want to stand in a circle so that the maximum difference between the growth of two neighboring children would be minimal possible.

Formally, let's number children from $1$ to $n$ in a circle order, that is, for every $i$ child with number $i$ will stand next to the child with number $i+1$, also the child with number $1$ stands next to the child with number $n$. Then we will call the discomfort of the circle the maximum absolute difference of heights of the children, who stand next to each other.

Please help children to find out how they should reorder themselves, so that the resulting discomfort is smallest possible.

-----Input-----

The first line contains a single integer $n$ ($2 \leq n \leq 100$) — the number of the children who came to the cowboy Vlad's birthday.

The second line contains integers $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq 10^9$) denoting heights of every child.

-----Output-----

Print exactly $n$ integers — heights of the children in the order in which they should stand in a circle. You can start printing a circle with any child.

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

-----Examples-----
Input
5
2 1 1 3 2

Output
1 2 3 2 1

Input
3
30 10 20

Output
10 20 30

-----Note-----

In the first example, the discomfort of the circle is equal to $1$, since the corresponding absolute differences are $1$, $1$, $1$ and $0$. Note, that sequences $[2, 3, 2, 1, 1]$ and $[3, 2, 1, 1, 2]$ form the same circles and differ only by the selection of the starting point.

In the second example, the discomfort of the circle is equal to $20$, since the absolute difference of $10$ and $30$ is equal to $20$.


Ivan is a novice painter. He has $n$ dyes of different colors. He also knows exactly $m$ pairs of colors which harmonize with each other.

Ivan also enjoy playing chess. He has $5000$ rooks. He wants to take $k$ rooks, paint each of them in one of $n$ colors and then place this $k$ rooks on a chessboard of size $10^{9} \times 10^{9}$.

Let's call the set of rooks on the board connected if from any rook we can get to any other rook in this set moving only through cells with rooks from this set. Assume that rooks can jump over other rooks, in other words a rook can go to any cell which shares vertical and to any cell which shares horizontal.

Ivan wants his arrangement of rooks to have following properties: For any color there is a rook of this color on a board; For any color the set of rooks of this color is connected; For any two different colors $a$ $b$ union of set of rooks of color $a$ and set of rooks of color $b$ is connected if and only if this two colors harmonize with each other.

Please help Ivan find such an arrangement.

-----Input-----

The first line of input contains $2$ integers $n$, $m$ ($1 \le n \le 100$, $0 \le m \le min(1000, \,\, \frac{n(n-1)}{2})$) — number of colors and number of pairs of colors which harmonize with each other.

In next $m$ lines pairs of colors which harmonize with each other are listed. Colors are numbered from $1$ to $n$. It is guaranteed that no pair occurs twice in this list.

-----Output-----

Print $n$ blocks, $i$-th of them describes rooks of $i$-th color.

In the first line of block print one number $a_{i}$ ($1 \le a_{i} \le 5000$) — number of rooks of color $i$. In each of next $a_{i}$ lines print two integers $x$ and $y$ ($1 \le x, \,\, y \le 10^{9}$) — coordinates of the next rook.

All rooks must be on different cells.

Total number of rooks must not exceed $5000$.

It is guaranteed that the solution exists.

-----Examples-----
Input
3 2
1 2
2 3

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

Input
3 3
1 2
2 3
3 1

Output
1
1 1
1
1 2
1
1 3

Input
3 1
1 3

Output
1
1 1
1
2 2
1
3 1

-----Note-----

Rooks arrangements for all three examples (red is color $1$, green is color $2$ and blue is color $3$).

$\left. \begin{array}{|l|l|l|l|l|l|l|} \hline 5 & {} & {} & {} & {} & {} \\ \hline 4 & {} & {} & {} & {} & {} \\ \hline 3 & {} & {} & {} & {} & {} \\ \hline 2 & {} & {} & {} & {} & {} \\ \hline 1 & {} & {} & {} & {} & {} \\ \hline & {1} & {2} & {3} & {4} & {5} \\ \hline \end{array} \right.$

$\left. \begin{array}{|l|l|l|l|} \hline 2 & {} & {} & {} \\ \hline 1 & {} & {} & {} \\ \hline & {1} & {2} & {3} \\ \hline \end{array} \right.$

$\left. \begin{array}{|l|l|l|l|} \hline 2 & {} & {} & {} \\ \hline 1 & {} & {} & {} \\ \hline & {1} & {2} & {3} \\ \hline \end{array} \right.$


Everybody knows that the $m$-coder Tournament will happen soon. $m$ schools participate in the tournament, and only one student from each school participates.

There are a total of $n$ students in those schools. Before the tournament, all students put their names and the names of their schools into the Technogoblet of Fire. After that, Technogoblet selects the strongest student from each school to participate.

Arkady is a hacker who wants to have $k$ Chosen Ones selected by the Technogoblet. Unfortunately, not all of them are the strongest in their schools, but Arkady can make up some new school names and replace some names from Technogoblet with those. You can't use each made-up name more than once. In that case, Technogoblet would select the strongest student in those made-up schools too.

You know the power of each student and schools they study in. Calculate the minimal number of schools Arkady has to make up so that $k$ Chosen Ones would be selected by the Technogoblet.

-----Input-----

The first line contains three integers $n$, $m$ and $k$ ($1 \le n \le 100$, $1 \le m, k \le n$) — the total number of students, the number of schools and the number of the Chosen Ones.

The second line contains $n$ different integers $p_1, p_2, \ldots, p_n$ ($1 \le p_i \le n$), where $p_i$ denotes the power of $i$-th student. The bigger the power, the stronger the student.

The third line contains $n$ integers $s_1, s_2, \ldots, s_n$ ($1 \le s_i \le m$), where $s_i$ denotes the school the $i$-th student goes to. At least one student studies in each of the schools.

The fourth line contains $k$ different integers $c_1, c_2, \ldots, c_k$ ($1 \le c_i \le n$)  — the id's of the Chosen Ones.

-----Output-----

Output a single integer  — the minimal number of schools to be made up by Arkady so that $k$ Chosen Ones would be selected by the Technogoblet.

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

Output
1

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

Output
2

-----Note-----

In the first example there's just a single Chosen One with id $3$. His power is equal to $3$, but in the same school $1$, there's a student with id $5$ and power $6$, and that means inaction would not lead to the latter being chosen. If we, however, make up a new school (let its id be $4$) for the Chosen One, Technogoblet would select students with ids $2$ (strongest in $3$), $5$ (strongest in $1$), $6$ (strongest in $2$) and $3$ (strongest in $4$).

In the second example, you can change the school of student $3$ to the made-up $5$ and the school of student $4$ to the made-up $6$. It will cause the Technogoblet to choose students $8$, $7$, $6$, $5$, $3$ and $4$.


You are given an array of $n$ integers $a_1$, $a_2$, ..., $a_n$, and a set $b$ of $k$ distinct integers from $1$ to $n$.

In one operation, you may choose two integers $i$ and $x$ ($1 \le i \le n$, $x$ can be any integer) and assign $a_i := x$. This operation can be done only if $i$ does not belong to the set $b$.

Calculate the minimum number of operations you should perform so the array $a$ is increasing (that is, $a_1 < a_2 < a_3 < \dots < a_n$), or report that it is impossible.

-----Input-----

The first line contains two integers $n$ and $k$ ($1 \le n \le 5 \cdot 10^5$, $0 \le k \le n$) — the size of the array $a$ and the set $b$, respectively.

The second line contains $n$ integers $a_1$, $a_2$, ..., $a_n$ ($1 \le a_i \le 10^9$).

Then, if $k \ne 0$, the third line follows, containing $k$ integers $b_1$, $b_2$, ..., $b_k$ ($1 \le b_1 < b_2 < \dots < b_k \le n$). If $k = 0$, this line is skipped.

-----Output-----

If it is impossible to make the array $a$ increasing using the given operations, print $-1$.

Otherwise, print one integer — the minimum number of operations you have to perform.

-----Examples-----
Input
7 2
1 2 1 1 3 5 1
3 5

Output
4

Input
3 3
1 3 2
1 2 3

Output
-1

Input
5 0
4 3 1 2 3

Output
2

Input
10 3
1 3 5 6 12 9 8 10 13 15
2 4 9

Output
3


You've been in love with Coronavirus-chan for a long time, but you didn't know where she lived until now. And just now you found out that she lives in a faraway place called Naha.

You immediately decided to take a vacation and visit Coronavirus-chan. Your vacation lasts exactly $x$ days and that's the exact number of days you will spend visiting your friend. You will spend exactly $x$ consecutive (successive) days visiting Coronavirus-chan.

They use a very unusual calendar in Naha: there are $n$ months in a year, $i$-th month lasts exactly $d_i$ days. Days in the $i$-th month are numbered from $1$ to $d_i$. There are no leap years in Naha.

The mood of Coronavirus-chan (and, accordingly, her desire to hug you) depends on the number of the day in a month. In particular, you get $j$ hugs if you visit Coronavirus-chan on the $j$-th day of the month.

You know about this feature of your friend and want to plan your trip to get as many hugs as possible (and then maybe you can win the heart of Coronavirus-chan).

Please note that your trip should not necessarily begin and end in the same year.

-----Input-----

The first line of input contains two integers $n$ and $x$ ($1 \le n \le 2 \cdot 10^5$) — the number of months in the year and the number of days you can spend with your friend.

The second line contains $n$ integers $d_1, d_2, \ldots, d_n$, $d_i$ is the number of days in the $i$-th month ($1 \le d_i \le 10^6$).

It is guaranteed that $1 \le x \le d_1 + d_2 + \ldots + d_n$.

-----Output-----

Print one integer — the maximum number of hugs that you can get from Coronavirus-chan during the best vacation in your life.

-----Examples-----
Input
3 2
1 3 1

Output
5
Input
3 6
3 3 3

Output
12
Input
5 6
4 2 3 1 3

Output
15

-----Note-----

In the first test case, the numbers of the days in a year are (indices of days in a corresponding month) $\{1,1,2,3,1\}$. Coronavirus-chan will hug you the most if you come on the third day of the year: $2+3=5$ hugs.

In the second test case, the numbers of the days are $\{1,2,3,1,2,3,1,2,3\}$. You will get the most hugs if you arrive on the third day of the year: $3+1+2+3+1+2=12$ hugs.

In the third test case, the numbers of the days are $\{1,2,3,4,1,2, 1,2,3, 1, 1,2,3\}$. You will get the most hugs if you come on the twelfth day of the year: your friend will hug you $2+3+1+2+3+4=15$ times.


Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. Eleven wants her name to have exactly n characters.  [Image]

Her friend suggested that her name should only consist of uppercase and lowercase letters 'O'. More precisely, they suggested that the i-th letter of her name should be 'O' (uppercase) if i is a member of Fibonacci sequence, and 'o' (lowercase) otherwise. The letters in the name are numbered from 1 to n. Fibonacci sequence is the sequence f where  f_1 = 1,  f_2 = 1,  f_{n} = f_{n} - 2 + f_{n} - 1 (n > 2).

As her friends are too young to know what Fibonacci sequence is, they asked you to help Eleven determine her new name.

-----Input-----

The first and only line of input contains an integer n (1 ≤ n ≤ 1000).

-----Output-----

Print Eleven's new name on the first and only line of output.

-----Examples-----
Input
8

Output
OOOoOooO

Input
15

Output
OOOoOooOooooOoo


Naman has two binary strings $s$ and $t$ of length $n$ (a binary string is a string which only consists of the characters "0" and "1"). He wants to convert $s$ into $t$ using the following operation as few times as possible.

In one operation, he can choose any subsequence of $s$ and rotate it clockwise once.

For example, if $s = 1\textbf{1}101\textbf{00}$, he can choose a subsequence corresponding to indices ($1$-based) $\{2, 6, 7 \}$ and rotate them clockwise. The resulting string would then be $s = 1\textbf{0}101\textbf{10}$.

A string $a$ is said to be a subsequence of string $b$ if $a$ can be obtained from $b$ by deleting some characters without changing the ordering of the remaining characters.

To perform a clockwise rotation on a sequence $c$ of size $k$ is to perform an operation which sets $c_1:=c_k, c_2:=c_1, c_3:=c_2, \ldots, c_k:=c_{k-1}$ simultaneously.

Determine the minimum number of operations Naman has to perform to convert $s$ into $t$ or say that it is impossible.

-----Input-----

The first line contains a single integer $n$ $(1 \le n \le 10^6)$ — the length of the strings.

The second line contains the binary string $s$ of length $n$.

The third line contains the binary string $t$ of length $n$.

-----Output-----

If it is impossible to convert $s$ to $t$ after any number of operations, print $-1$.

Otherwise, print the minimum number of operations required.

-----Examples-----
Input
6
010000
000001

Output
1
Input
10
1111100000
0000011111

Output
5
Input
8
10101010
01010101

Output
1
Input
10
1111100000
1111100001

Output
-1

-----Note-----

In the first test, Naman can choose the subsequence corresponding to indices $\{2, 6\}$ and rotate it once to convert $s$ into $t$.

In the second test, he can rotate the subsequence corresponding to all indices $5$ times. It can be proved, that it is the minimum required number of operations.

In the last test, it is impossible to convert $s$ into $t$.


A well-known art union called "Kalevich is Alive!" manufactures objects d'art (pictures). The union consists of n painters who decided to organize their work as follows.

Each painter uses only the color that was assigned to him. The colors are distinct for all painters. Let's assume that the first painter uses color 1, the second one uses color 2, and so on. Each picture will contain all these n colors. Adding the j-th color to the i-th picture takes the j-th painter t_{ij} units of time.

Order is important everywhere, so the painters' work is ordered by the following rules:  Each picture is first painted by the first painter, then by the second one, and so on. That is, after the j-th painter finishes working on the picture, it must go to the (j + 1)-th painter (if j < n);  each painter works on the pictures in some order: first, he paints the first picture, then he paints the second picture and so on;  each painter can simultaneously work on at most one picture. However, the painters don't need any time to have a rest;  as soon as the j-th painter finishes his part of working on the picture, the picture immediately becomes available to the next painter.

Given that the painters start working at time 0, find for each picture the time when it is ready for sale.

-----Input-----

The first line of the input contains integers m, n (1 ≤ m ≤ 50000, 1 ≤ n ≤ 5), where m is the number of pictures and n is the number of painters. Then follow the descriptions of the pictures, one per line. Each line contains n integers t_{i}1, t_{i}2, ..., t_{in} (1 ≤ t_{ij} ≤ 1000), where t_{ij} is the time the j-th painter needs to work on the i-th picture.

-----Output-----

Print the sequence of m integers r_1, r_2, ..., r_{m}, where r_{i} is the moment when the n-th painter stopped working on the i-th picture.

-----Examples-----
Input
5 1
1
2
3
4
5

Output
1 3 6 10 15
Input
4 2
2 5
3 1
5 3
10 1

Output
7 8 13 21


The academic year has just begun, but lessons and olympiads have already occupied all the free time. It is not a surprise that today Olga fell asleep on the Literature. She had a dream in which she was on a stairs.

The stairs consists of n steps. The steps are numbered from bottom to top, it means that the lowest step has number 1, and the highest step has number n. Above each of them there is a pointer with the direction (up or down) Olga should move from this step. As soon as Olga goes to the next step, the direction of the pointer (above the step she leaves) changes. It means that the direction "up" changes to "down", the direction "down"  —  to the direction "up".

Olga always moves to the next step in the direction which is shown on the pointer above the step.

If Olga moves beyond the stairs, she will fall and wake up. Moving beyond the stairs is a moving down from the first step or moving up from the last one (it means the n-th) step.

In one second Olga moves one step up or down according to the direction of the pointer which is located above the step on which Olga had been at the beginning of the second.

For each step find the duration of the dream if Olga was at this step at the beginning of the dream.

Olga's fall also takes one second, so if she was on the first step and went down, she would wake up in the next second.

-----Input-----

The first line contains single integer n (1 ≤ n ≤ 10^6) — the number of steps on the stairs.

The second line contains a string s with the length n — it denotes the initial direction of pointers on the stairs. The i-th character of string s denotes the direction of the pointer above i-th step, and is either 'U' (it means that this pointer is directed up), or 'D' (it means this pointed is directed down).

The pointers are given in order from bottom to top.

-----Output-----

Print n numbers, the i-th of which is equal either to the duration of Olga's dream or to  - 1 if Olga never goes beyond the stairs, if in the beginning of sleep she was on the i-th step.

-----Examples-----
Input
3
UUD

Output
5 6 3
Input
10
UUDUDUUDDU

Output
5 12 23 34 36 27 18 11 6 1


Seryozha has a very changeable character. This time he refused to leave the room to Dima and his girlfriend (her hame is Inna, by the way). However, the two lovebirds can always find a way to communicate. Today they are writing text messages to each other.

Dima and Inna are using a secret code in their text messages. When Dima wants to send Inna some sentence, he writes out all words, inserting a heart before each word and after the last word. A heart is a sequence of two characters: the "less" characters (<) and the digit three (3). After applying the code, a test message looks like that: <3word_1<3word_2<3 ... word_{n}<3.

Encoding doesn't end here. Then Dima inserts a random number of small English characters, digits, signs "more" and "less" into any places of the message.

Inna knows Dima perfectly well, so she knows what phrase Dima is going to send her beforehand. Inna has just got a text message. Help her find out if Dima encoded the message correctly. In other words, find out if a text message could have been received by encoding in the manner that is described above.

-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5) — the number of words in Dima's message. Next n lines contain non-empty words, one word per line. The words only consist of small English letters. The total length of all words doesn't exceed 10^5.

The last line contains non-empty text message that Inna has got. The number of characters in the text message doesn't exceed 10^5. A text message can contain only small English letters, digits and signs more and less.

-----Output-----

In a single line, print "yes" (without the quotes), if Dima decoded the text message correctly, and "no" (without the quotes) otherwise.

-----Examples-----
Input
3
i
love
you
<3i<3love<23you<3

Output
yes

Input
7
i
am
not
main
in
the
family
<3i<>3am<3the<3<main<3in<3the<3><3family<3

Output
no

-----Note-----

Please note that Dima got a good old kick in the pants for the second sample from the statement.


A social network for dogs called DH (DogHouse) has k special servers to recompress uploaded videos of cute cats. After each video is uploaded, it should be recompressed on one (any) of the servers, and only after that it can be saved in the social network.

We know that each server takes one second to recompress a one minute fragment. Thus, any server takes m seconds to recompress a m minute video.

We know the time when each of the n videos were uploaded to the network (in seconds starting from the moment all servers started working). All videos appear at different moments of time and they are recompressed in the order they appear. If some video appeared at time s, then its recompressing can start at that very moment, immediately. Some videos can await recompressing when all the servers are busy. In this case, as soon as a server is available, it immediately starts recompressing another video. The videos that await recompressing go in a queue. If by the moment the videos started being recompressed some servers are available, then any of them starts recompressing the video.

For each video find the moment it stops being recompressed.

-----Input-----

The first line of the input contains integers n and k (1 ≤ n, k ≤ 5·10^5) — the number of videos and servers, respectively.

Next n lines contain the descriptions of the videos as pairs of integers s_{i}, m_{i} (1 ≤ s_{i}, m_{i} ≤ 10^9), where s_{i} is the time in seconds when the i-th video appeared and m_{i} is its duration in minutes. It is guaranteed that all the s_{i}'s are distinct and the videos are given in the chronological order of upload, that is in the order of increasing s_{i}.

-----Output-----

Print n numbers e_1, e_2, ..., e_{n}, where e_{i} is the time in seconds after the servers start working, when the i-th video will be recompressed.

-----Examples-----
Input
3 2
1 5
2 5
3 5

Output
6
7
11

Input
6 1
1 1000000000
2 1000000000
3 1000000000
4 1000000000
5 1000000000
6 3

Output
1000000001
2000000001
3000000001
4000000001
5000000001
5000000004


You have to restore the wall. The wall consists of $N$ pillars of bricks, the height of the $i$-th pillar is initially equal to $h_{i}$, the height is measured in number of bricks. After the restoration all the $N$ pillars should have equal heights.

You are allowed the following operations: put a brick on top of one pillar, the cost of this operation is $A$; remove a brick from the top of one non-empty pillar, the cost of this operation is $R$; move a brick from the top of one non-empty pillar to the top of another pillar, the cost of this operation is $M$.

You cannot create additional pillars or ignore some of pre-existing pillars even if their height becomes $0$.

What is the minimal total cost of restoration, in other words, what is the minimal total cost to make all the pillars of equal height?

-----Input-----

The first line of input contains four integers $N$, $A$, $R$, $M$ ($1 \le N \le 10^{5}$, $0 \le A, R, M \le 10^{4}$) — the number of pillars and the costs of operations.

The second line contains $N$ integers $h_{i}$ ($0 \le h_{i} \le 10^{9}$) — initial heights of pillars.

-----Output-----

Print one integer — the minimal cost of restoration.

-----Examples-----
Input
3 1 100 100
1 3 8

Output
12

Input
3 100 1 100
1 3 8

Output
9

Input
3 100 100 1
1 3 8

Output
4

Input
5 1 2 4
5 5 3 6 5

Output
4

Input
5 1 2 2
5 5 3 6 5

Output
3


Petya and Gena love playing table tennis. A single match is played according to the following rules: a match consists of multiple sets, each set consists of multiple serves. Each serve is won by one of the players, this player scores one point. As soon as one of the players scores t points, he wins the set; then the next set starts and scores of both players are being set to 0. As soon as one of the players wins the total of s sets, he wins the match and the match is over. Here s and t are some positive integer numbers.

To spice it up, Petya and Gena choose new numbers s and t before every match. Besides, for the sake of history they keep a record of each match: that is, for each serve they write down the winner. Serve winners are recorded in the chronological order. In a record the set is over as soon as one of the players scores t points and the match is over as soon as one of the players wins s sets.

Petya and Gena have found a record of an old match. Unfortunately, the sequence of serves in the record isn't divided into sets and numbers s and t for the given match are also lost. The players now wonder what values of s and t might be. Can you determine all the possible options?

-----Input-----

The first line contains a single integer n — the length of the sequence of games (1 ≤ n ≤ 10^5).

The second line contains n space-separated integers a_{i}. If a_{i} = 1, then the i-th serve was won by Petya, if a_{i} = 2, then the i-th serve was won by Gena.

It is not guaranteed that at least one option for numbers s and t corresponds to the given record.

-----Output-----

In the first line print a single number k — the number of options for numbers s and t.

In each of the following k lines print two integers s_{i} and t_{i} — the option for numbers s and t. Print the options in the order of increasing s_{i}, and for equal s_{i} — in the order of increasing t_{i}.

-----Examples-----
Input
5
1 2 1 2 1

Output
2
1 3
3 1

Input
4
1 1 1 1

Output
3
1 4
2 2
4 1

Input
4
1 2 1 2

Output
0

Input
8
2 1 2 1 1 1 1 1

Output
3
1 6
2 3
6 1


Vasily the bear has got a sequence of positive integers a_1, a_2, ..., a_{n}. Vasily the Bear wants to write out several numbers on a piece of paper so that the beauty of the numbers he wrote out was maximum.

The beauty of the written out numbers b_1, b_2, ..., b_{k} is such maximum non-negative integer v, that number b_1 and b_2 and ... and b_{k} is divisible by number 2^{v} without a remainder. If such number v doesn't exist (that is, for any non-negative integer v, number b_1 and b_2 and ... and b_{k} is divisible by 2^{v} without a remainder), the beauty of the written out numbers equals -1.

Tell the bear which numbers he should write out so that the beauty of the written out numbers is maximum. If there are multiple ways to write out the numbers, you need to choose the one where the bear writes out as many numbers as possible.

Here expression x and y means applying the bitwise AND operation to numbers x and y. In programming languages C++ and Java this operation is represented by "&", in Pascal — by "and".

-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5). The second line contains n space-separated integers a_1, a_2, ..., a_{n} (1 ≤ a_1 < a_2 < ... < a_{n} ≤ 10^9).

-----Output-----

In the first line print a single integer k (k > 0), showing how many numbers to write out. In the second line print k integers b_1, b_2, ..., b_{k} — the numbers to write out. You are allowed to print numbers b_1, b_2, ..., b_{k} in any order, but all of them must be distinct. If there are multiple ways to write out the numbers, choose the one with the maximum number of numbers to write out. If there still are multiple ways, you are allowed to print any of them.

-----Examples-----
Input
5
1 2 3 4 5

Output
2
4 5

Input
3
1 2 4

Output
1
4


Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns, Sereja moves first. During his turn a player can take one card: either the leftmost card in a row, or the rightmost one. The game ends when there is no more cards. The player who has the maximum sum of numbers on his cards by the end of the game, wins.

Sereja and Dima are being greedy. Each of them chooses the card with the larger number during his move.

Inna is a friend of Sereja and Dima. She knows which strategy the guys are using, so she wants to determine the final score, given the initial state of the game. Help her.

-----Input-----

The first line contains integer n (1 ≤ n ≤ 1000) — the number of cards on the table. The second line contains space-separated numbers on the cards from left to right. The numbers on the cards are distinct integers from 1 to 1000.

-----Output-----

On a single line, print two integers. The first number is the number of Sereja's points at the end of the game, the second number is the number of Dima's points at the end of the game.

-----Examples-----
Input
4
4 1 2 10

Output
12 5

Input
7
1 2 3 4 5 6 7

Output
16 12

-----Note-----

In the first sample Sereja will take cards with numbers 10 and 2, so Sereja's sum is 12. Dima will take cards with numbers 4 and 1, so Dima's sum is 5.


Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his company should be the best. That is why every candidate needs to pass through the interview that consists of the following problem.

We define function f(x, l, r) as a bitwise OR of integers x_{l}, x_{l} + 1, ..., x_{r}, where x_{i} is the i-th element of the array x. You are given two arrays a and b of length n. You need to determine the maximum value of sum f(a, l, r) + f(b, l, r) among all possible 1 ≤ l ≤ r ≤ n. [Image]

-----Input-----

The first line of the input contains a single integer n (1 ≤ n ≤ 1000) — the length of the arrays.

The second line contains n integers a_{i} (0 ≤ a_{i} ≤ 10^9).

The third line contains n integers b_{i} (0 ≤ b_{i} ≤ 10^9).

-----Output-----

Print a single integer — the maximum value of sum f(a, l, r) + f(b, l, r) among all possible 1 ≤ l ≤ r ≤ n.

-----Examples-----
Input
5
1 2 4 3 2
2 3 3 12 1

Output
22
Input
10
13 2 7 11 8 4 9 8 5 1
5 7 18 9 2 3 0 11 8 6

Output
46

-----Note-----

Bitwise OR of two non-negative integers a and b is the number c = a OR b, such that each of its digits in binary notation is 1 if and only if at least one of a or b have 1 in the corresponding position in binary notation.

In the first sample, one of the optimal answers is l = 2 and r = 4, because f(a, 2, 4) + f(b, 2, 4) = (2 OR 4 OR 3) + (3 OR 3 OR 12) = 7 + 15 = 22. Other ways to get maximum value is to choose l = 1 and r = 4, l = 1 and r = 5, l = 2 and r = 4, l = 2 and r = 5, l = 3 and r = 4, or l = 3 and r = 5.

In the second sample, the maximum value is obtained for l = 1 and r = 9.


Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!

Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has n pieces numbered from 1 to n from left to right, and the i-th piece has a colour s_{i}, denoted by a lowercase English letter. Nadeko will repaint at most m of the pieces to give each of them an arbitrary new colour (still denoted by a lowercase English letter). After this work, she finds out all subsegments of the garland containing pieces of only colour c — Brother Koyomi's favourite one, and takes the length of the longest among them to be the Koyomity of the garland.

For instance, let's say the garland is represented by "kooomo", and Brother Koyomi's favourite colour is "o". Among all subsegments containing pieces of "o" only, "ooo" is the longest, with a length of 3. Thus the Koyomity of this garland equals 3.

But problem arises as Nadeko is unsure about Brother Koyomi's favourite colour, and has swaying ideas on the amount of work to do. She has q plans on this, each of which can be expressed as a pair of an integer m_{i} and a lowercase letter c_{i}, meanings of which are explained above. You are to find out the maximum Koyomity achievable after repainting the garland according to each plan.

-----Input-----

The first line of input contains a positive integer n (1 ≤ n ≤ 1 500) — the length of the garland.

The second line contains n lowercase English letters s_1s_2... s_{n} as a string — the initial colours of paper pieces on the garland.

The third line contains a positive integer q (1 ≤ q ≤ 200 000) — the number of plans Nadeko has.

The next q lines describe one plan each: the i-th among them contains an integer m_{i} (1 ≤ m_{i} ≤ n) — the maximum amount of pieces to repaint, followed by a space, then by a lowercase English letter c_{i} — Koyomi's possible favourite colour.

-----Output-----

Output q lines: for each work plan, output one line containing an integer — the largest Koyomity achievable after repainting the garland according to it.

-----Examples-----
Input
6
koyomi
3
1 o
4 o
4 m

Output
3
6
5

Input
15
yamatonadeshiko
10
1 a
2 a
3 a
4 a
5 a
1 b
2 b
3 b
4 b
5 b

Output
3
4
5
7
8
1
2
3
4
5

Input
10
aaaaaaaaaa
2
10 b
10 z

Output
10
10

-----Note-----

In the first sample, there are three plans:   In the first plan, at most 1 piece can be repainted. Repainting the "y" piece to become "o" results in "kooomi", whose Koyomity of 3 is the best achievable;  In the second plan, at most 4 pieces can be repainted, and "oooooo" results in a Koyomity of 6;  In the third plan, at most 4 pieces can be repainted, and "mmmmmi" and "kmmmmm" both result in a Koyomity of 5.


Hiking club "Up the hill" just returned from a walk. Now they are trying to remember which hills they've just walked through.

It is known that there were N stops, all on different integer heights between 1 and N kilometers (inclusive) above the sea level. On the first day they've traveled from the first stop to the second stop, on the second day they've traveled from the second to the third and so on, and on the last day they've traveled from the stop N - 1 to the stop N and successfully finished their expedition.

They are trying to find out which heights were their stops located at. They have an entry in a travel journal specifying how many days did they travel up the hill, and how many days did they walk down the hill.

Help them by suggesting some possible stop heights satisfying numbers from the travel journal.

-----Input-----

In the first line there is an integer non-negative number A denoting the number of days of climbing up the hill. Second line contains an integer non-negative number B — the number of days of walking down the hill (A + B + 1 = N, 1 ≤ N ≤ 100 000).

-----Output-----

Output N space-separated distinct integers from 1 to N inclusive, denoting possible heights of the stops in order of visiting.

-----Examples-----
Input
0
1

Output
2 1

Input
2
1
Output
1 3 4 2


Vasya is reading a e-book. The file of the book consists of $n$ pages, numbered from $1$ to $n$. The screen is currently displaying the contents of page $x$, and Vasya wants to read the page $y$. There are two buttons on the book which allow Vasya to scroll $d$ pages forwards or backwards (but he cannot scroll outside the book). For example, if the book consists of $10$ pages, and $d = 3$, then from the first page Vasya can scroll to the first or to the fourth page by pressing one of the buttons; from the second page — to the first or to the fifth; from the sixth page — to the third or to the ninth; from the eighth — to the fifth or to the tenth.

Help Vasya to calculate the minimum number of times he needs to press a button to move to page $y$.

-----Input-----

The first line contains one integer $t$ ($1 \le t \le 10^3$) — the number of testcases.

Each testcase is denoted by a line containing four integers $n$, $x$, $y$, $d$ ($1\le n, d \le 10^9$, $1 \le x, y \le n$) — the number of pages, the starting page, the desired page, and the number of pages scrolled by pressing one button, respectively.

-----Output-----

Print one line for each test.

If Vasya can move from page $x$ to page $y$, print the minimum number of times he needs to press a button to do it. Otherwise print $-1$.

-----Example-----
Input
3
10 4 5 2
5 1 3 4
20 4 19 3

Output
4
-1
5

-----Note-----

In the first test case the optimal sequence is: $4 \rightarrow 2 \rightarrow 1 \rightarrow 3 \rightarrow 5$.

In the second test case it is possible to get to pages $1$ and $5$.

In the third test case the optimal sequence is: $4 \rightarrow 7 \rightarrow 10 \rightarrow 13 \rightarrow 16 \rightarrow 19$.


Gathering darkness shrouds the woods and the world. The moon sheds its light on the boat and the river.

"To curtain off the moonlight should be hardly possible; the shades present its mellow beauty and restful nature." Intonates Mino.

"See? The clouds are coming." Kanno gazes into the distance.

"That can't be better," Mino turns to Kanno.

The sky can be seen as a one-dimensional axis. The moon is at the origin whose coordinate is $0$.

There are $n$ clouds floating in the sky. Each cloud has the same length $l$. The $i$-th initially covers the range of $(x_i, x_i + l)$ (endpoints excluded). Initially, it moves at a velocity of $v_i$, which equals either $1$ or $-1$.

Furthermore, no pair of clouds intersect initially, that is, for all $1 \leq i \lt j \leq n$, $\lvert x_i - x_j \rvert \geq l$.

With a wind velocity of $w$, the velocity of the $i$-th cloud becomes $v_i + w$. That is, its coordinate increases by $v_i + w$ during each unit of time. Note that the wind can be strong and clouds can change their direction.

You are to help Mino count the number of pairs $(i, j)$ ($i < j$), such that with a proper choice of wind velocity $w$ not exceeding $w_\mathrm{max}$ in absolute value (possibly negative and/or fractional), the $i$-th and $j$-th clouds both cover the moon at the same future moment. This $w$ doesn't need to be the same across different pairs.

-----Input-----

The first line contains three space-separated integers $n$, $l$, and $w_\mathrm{max}$ ($1 \leq n \leq 10^5$, $1 \leq l, w_\mathrm{max} \leq 10^8$) — the number of clouds, the length of each cloud and the maximum wind speed, respectively.

The $i$-th of the following $n$ lines contains two space-separated integers $x_i$ and $v_i$ ($-10^8 \leq x_i \leq 10^8$, $v_i \in \{-1, 1\}$) — the initial position and the velocity of the $i$-th cloud, respectively.

The input guarantees that for all $1 \leq i \lt j \leq n$, $\lvert x_i - x_j \rvert \geq l$.

-----Output-----

Output one integer — the number of unordered pairs of clouds such that it's possible that clouds from each pair cover the moon at the same future moment with a proper choice of wind velocity $w$.

-----Examples-----
Input
5 1 2
-2 1
2 1
3 -1
5 -1
7 -1

Output
4

Input
4 10 1
-20 1
-10 -1
0 1
10 -1

Output
1

-----Note-----

In the first example, the initial positions and velocities of clouds are illustrated below.

 [Image]

The pairs are:   $(1, 3)$, covering the moon at time $2.5$ with $w = -0.4$;  $(1, 4)$, covering the moon at time $3.5$ with $w = -0.6$;  $(1, 5)$, covering the moon at time $4.5$ with $w = -0.7$;  $(2, 5)$, covering the moon at time $2.5$ with $w = -2$.

Below is the positions of clouds at time $2.5$ with $w = -0.4$. At this moment, the $1$-st and $3$-rd clouds both cover the moon.

 [Image]

In the second example, the only pair is $(1, 4)$, covering the moon at time $15$ with $w = 0$.

Note that all the times and wind velocities given above are just examples among infinitely many choices.


A flower shop has got n bouquets, and the i-th bouquet consists of a_{i} flowers. Vasya, the manager of the shop, decided to make large bouquets from these bouquets.

Vasya thinks that a bouquet is large if it is made of two or more initial bouquets, and there is a constraint: the total number of flowers in a large bouquet should be odd. Each of the initial bouquets can be a part of at most one large bouquet. If an initial bouquet becomes a part of a large bouquet, all its flowers are included in the large bouquet.

Determine the maximum possible number of large bouquets Vasya can make.

-----Input-----

The first line contains a single positive integer n (1 ≤ n ≤ 10^5) — the number of initial bouquets.

The second line contains a sequence of integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^6) — the number of flowers in each of the initial bouquets.

-----Output-----

Print the maximum number of large bouquets Vasya can make.

-----Examples-----
Input
5
2 3 4 2 7

Output
2

Input
6
2 2 6 8 6 12

Output
0

Input
3
11 4 10

Output
1

-----Note-----

In the first example Vasya can make 2 large bouquets. For example, the first bouquet can contain the first and the fifth initial bouquets (the total number of flowers is then equal to 9), and the second bouquet can consist of the second and the third initial bouquets (the total number of flowers is then equal to 7). The fourth initial bouquet is unused in this scheme.

In the second example it is not possible to form a single bouquet with odd number of flowers.

In the third example Vasya can make one large bouquet. For example, he can make it using all three initial bouquets. The size of the large bouquet is then equal to 11 + 4 + 10 = 25.


Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.

Lala Land has exactly n apple trees. Tree number i is located in a position x_{i} and has a_{i} apples growing on it. Amr wants to collect apples from the apple trees. Amr currently stands in x = 0 position. At the beginning, he can choose whether to go right or left. He'll continue in his direction until he meets an apple tree he didn't visit before. He'll take all of its apples and then reverse his direction, continue walking in this direction until he meets another apple tree he didn't visit before and so on. In the other words, Amr reverses his direction when visiting each new apple tree. Amr will stop collecting apples when there are no more trees he didn't visit in the direction he is facing.

What is the maximum number of apples he can collect?

-----Input-----

The first line contains one number n (1 ≤ n ≤ 100), the number of apple trees in Lala Land.

The following n lines contains two integers each x_{i}, a_{i} ( - 10^5 ≤ x_{i} ≤ 10^5, x_{i} ≠ 0, 1 ≤ a_{i} ≤ 10^5), representing the position of the i-th tree and number of apples on it.

It's guaranteed that there is at most one apple tree at each coordinate. It's guaranteed that no tree grows in point 0.

-----Output-----

Output the maximum number of apples Amr can collect.

-----Examples-----
Input
2
-1 5
1 5

Output
10
Input
3
-2 2
1 4
-1 3

Output
9
Input
3
1 9
3 5
7 10

Output
9

-----Note-----

In the first sample test it doesn't matter if Amr chose at first to go left or right. In both cases he'll get all the apples.

In the second sample test the optimal solution is to go left to x =  - 1, collect apples from there, then the direction will be reversed, Amr has to go to x = 1, collect apples from there, then the direction will be reversed and Amr goes to the final tree x =  - 2.

In the third sample test the optimal solution is to go right to x = 1, collect apples from there, then the direction will be reversed and Amr will not be able to collect anymore apples because there are no apple trees to his left.


The famous joke programming language HQ9+ has only 4 commands. In this problem we will explore its subset — a language called HQ...

-----Input-----

The only line of the input is a string between 1 and 10^6 characters long.

-----Output-----

Output "Yes" or "No".

-----Examples-----
Input
HHHH

Output
Yes

Input
HQHQH

Output
No

Input
HHQHHQH

Output
No

Input
HHQQHHQQHH

Output
Yes

-----Note-----

The rest of the problem statement was destroyed by a stray raccoon. We are terribly sorry for the inconvenience.


An army of n droids is lined up in one row. Each droid is described by m integers a_1, a_2, ..., a_{m}, where a_{i} is the number of details of the i-th type in this droid's mechanism. R2-D2 wants to destroy the sequence of consecutive droids of maximum length. He has m weapons, the i-th weapon can affect all the droids in the army by destroying one detail of the i-th type (if the droid doesn't have details of this type, nothing happens to it).

A droid is considered to be destroyed when all of its details are destroyed. R2-D2 can make at most k shots. How many shots from the weapon of what type should R2-D2 make to destroy the sequence of consecutive droids of maximum length?

-----Input-----

The first line contains three integers n, m, k (1 ≤ n ≤ 10^5, 1 ≤ m ≤ 5, 0 ≤ k ≤ 10^9) — the number of droids, the number of detail types and the number of available shots, respectively.

Next n lines follow describing the droids. Each line contains m integers a_1, a_2, ..., a_{m} (0 ≤ a_{i} ≤ 10^8), where a_{i} is the number of details of the i-th type for the respective robot.

-----Output-----

Print m space-separated integers, where the i-th number is the number of shots from the weapon of the i-th type that the robot should make to destroy the subsequence of consecutive droids of the maximum length.

If there are multiple optimal solutions, print any of them.

It is not necessary to make exactly k shots, the number of shots can be less.

-----Examples-----
Input
5 2 4
4 0
1 2
2 1
0 2
1 3

Output
2 2

Input
3 2 4
1 2
1 3
2 2

Output
1 3

-----Note-----

In the first test the second, third and fourth droids will be destroyed.

In the second test the first and second droids will be destroyed.


Ancient Egyptians are known to have understood difficult concepts in mathematics. The ancient Egyptian mathematician Ahmes liked to write a kind of arithmetic expressions on papyrus paper which he called as Ahmes arithmetic expression.

An Ahmes arithmetic expression can be defined as:   "d" is an Ahmes arithmetic expression, where d is a one-digit positive integer;  "(E_1 op E_2)" is an Ahmes arithmetic expression, where E_1 and E_2 are valid Ahmes arithmetic expressions (without spaces) and op is either plus ( + ) or minus ( - ).  For example 5, (1-1) and ((1+(2-3))-5) are valid Ahmes arithmetic expressions.

On his trip to Egypt, Fafa found a piece of papyrus paper having one of these Ahmes arithmetic expressions written on it. Being very ancient, the papyrus piece was very worn out. As a result, all the operators were erased, keeping only the numbers and the brackets. Since Fafa loves mathematics, he decided to challenge himself with the following task:

Given the number of plus and minus operators in the original expression, find out the maximum possible value for the expression on the papyrus paper after putting the plus and minus operators in the place of the original erased operators.

-----Input-----

The first line contains a string E (1 ≤ |E| ≤ 10^4) — a valid Ahmes arithmetic expression. All operators are erased and replaced with '?'.

The second line contains two space-separated integers P and M (0 ≤ min(P, M) ≤ 100) — the number of plus and minus operators, respectively.

It is guaranteed that P + M =  the number of erased operators.

-----Output-----

Print one line containing the answer to the problem.

-----Examples-----
Input
(1?1)
1 0

Output
2

Input
(2?(1?2))
1 1

Output
1

Input
((1?(5?7))?((6?2)?7))
3 2

Output
18

Input
((1?(5?7))?((6?2)?7))
2 3

Output
16

-----Note-----  The first sample will be (1 + 1)  =  2.  The second sample will be (2 + (1 - 2))  =  1.  The third sample will be ((1 - (5 - 7)) + ((6 + 2) + 7))  =  18.  The fourth sample will be ((1 + (5 + 7)) - ((6 - 2) - 7))  =  16.


One day, Yuhao came across a problem about checking if some bracket sequences are correct bracket sequences.

A bracket sequence is any non-empty sequence of opening and closing parentheses. A bracket sequence is called a correct bracket sequence if it's possible to obtain a correct arithmetic expression by inserting characters "+" and "1" into this sequence. For example, the sequences "(())()", "()" and "(()(()))" are correct, while the bracket sequences ")(", "(()" and "(()))(" are not correct.

Yuhao found this problem too simple for him so he decided to make the problem harder. You are given many (not necessarily correct) bracket sequences. The task is to connect some of them into ordered pairs so that each bracket sequence occurs in at most one pair and the concatenation of the bracket sequences in each pair is a correct bracket sequence. The goal is to create as many pairs as possible.

This problem unfortunately turned out to be too difficult for Yuhao. Can you help him and solve it?

-----Input-----

The first line contains one integer $n$ ($1 \leq n \leq 10^5$) — the number of bracket sequences.

Each of the following $n$ lines contains one bracket sequence — a non-empty string which consists only of characters "(" and ")".

The sum of lengths of all bracket sequences in the input is at most $5 \cdot 10^5$.

Note that a bracket sequence may appear in the input multiple times. In this case, you can use each copy of the sequence separately. Also note that the order in which strings appear in the input doesn't matter.

-----Output-----

Print a single integer — the maximum number of pairs which can be made, adhering to the conditions in the statement.

-----Examples-----
Input
7
)())
)
((
((
(
)
)

Output
2

Input
4
(
((
(((
(())

Output
0

Input
2
(())
()

Output
1

-----Note-----

In the first example, it's optimal to construct two pairs: "((     )())" and "(     )".


Two players A and B have a list of $n$ integers each. They both want to maximize the subtraction between their score and their opponent's score.

In one turn, a player can either add to his score any element from his list (assuming his list is not empty), the element is removed from the list afterward. Or remove an element from his opponent's list (assuming his opponent's list is not empty).

Note, that in case there are equal elements in the list only one of them will be affected in the operations above. For example, if there are elements $\{1, 2, 2, 3\}$ in a list and you decided to choose $2$ for the next turn, only a single instance of $2$ will be deleted (and added to the score, if necessary).

The player A starts the game and the game stops when both lists are empty. Find the difference between A's score and B's score at the end of the game, if both of the players are playing optimally.

Optimal play between two players means that both players choose the best possible strategy to achieve the best possible outcome for themselves. In this problem, it means that each player, each time makes a move, which maximizes the final difference between his score and his opponent's score, knowing that the opponent is doing the same.

-----Input-----

The first line of input contains an integer $n$ ($1 \le n \le 100\,000$) — the sizes of the list.

The second line contains $n$ integers $a_i$ ($1 \le a_i \le 10^6$), describing the list of the player A, who starts the game.

The third line contains $n$ integers $b_i$ ($1 \le b_i \le 10^6$), describing the list of the player B.

-----Output-----

Output the difference between A's score and B's score ($A-B$) if both of them are playing optimally.

-----Examples-----
Input
2
1 4
5 1

Output
0
Input
3
100 100 100
100 100 100

Output
0
Input
2
2 1
5 6

Output
-3

-----Note-----

In the first example, the game could have gone as follows:   A removes $5$ from B's list.  B removes $4$ from A's list.  A takes his $1$.  B takes his $1$.

Hence, A's score is $1$, B's score is $1$ and difference is $0$.

There is also another optimal way of playing:  A removes $5$ from B's list.  B removes $4$ from A's list.  A removes $1$ from B's list.  B removes $1$ from A's list.

The difference in the scores is still $0$.

In the second example, irrespective of the moves the players make, they will end up with the same number of numbers added to their score, so the difference will be $0$.


There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.

You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in the same order.

You are also given some text consisting of small and capital English letters and digits. It is known that it was typed in the first layout, but the writer intended to type it in the second layout. Print the text if the same keys were pressed in the second layout.

Since all keys but letters are the same in both layouts, the capitalization of the letters should remain the same, as well as all other characters.

-----Input-----

The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout.

The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout.

The third line contains a non-empty string s consisting of lowercase and uppercase English letters and digits. This is the text typed in the first layout. The length of s does not exceed 1000.

-----Output-----

Print the text if the same keys were pressed in the second layout.

-----Examples-----
Input
qwertyuiopasdfghjklzxcvbnm
veamhjsgqocnrbfxdtwkylupzi
TwccpQZAvb2017

Output
HelloVKCup2017

Input
mnbvcxzlkjhgfdsapoiuytrewq
asdfghjklqwertyuiopzxcvbnm
7abaCABAABAcaba7

Output
7uduGUDUUDUgudu7


Eugeny has array a = a_1, a_2, ..., a_{n}, consisting of n integers. Each integer a_{i} equals to -1, or to 1. Also, he has m queries:  Query number i is given as a pair of integers l_{i}, r_{i} (1 ≤ l_{i} ≤ r_{i} ≤ n).  The response to the query will be integer 1, if the elements of array a can be rearranged so as the sum a_{l}_{i} + a_{l}_{i} + 1 + ... + a_{r}_{i} = 0, otherwise the response to the query will be integer 0.

Help Eugeny, answer all his queries.

-----Input-----

The first line contains integers n and m (1 ≤ n, m ≤ 2·10^5). The second line contains n integers a_1, a_2, ..., a_{n} (a_{i} = -1, 1). Next m lines contain Eugene's queries. The i-th line contains integers l_{i}, r_{i} (1 ≤ l_{i} ≤ r_{i} ≤ n).

-----Output-----

Print m integers — the responses to Eugene's queries in the order they occur in the input.

-----Examples-----
Input
2 3
1 -1
1 1
1 2
2 2

Output
0
1
0

Input
5 5
-1 1 1 1 -1
1 1
2 3
3 5
2 5
1 5

Output
0
1
0
1
0


В самолёте есть n рядов мест. Если смотреть на ряды сверху, то в каждом ряду есть 3 места слева, затем проход между рядами, затем 4 центральных места, затем ещё один проход между рядами, а затем ещё 3 места справа.

Известно, что некоторые места уже заняты пассажирами. Всего есть два вида пассажиров — статусные (те, которые часто летают) и обычные.

Перед вами стоит задача рассадить ещё k обычных пассажиров так, чтобы суммарное число соседей у статусных пассажиров было минимально возможным. Два пассажира считаются соседями, если они сидят в одном ряду и между ними нет других мест и прохода между рядами. Если пассажир является соседним пассажиром для двух статусных пассажиров, то его следует учитывать в сумме соседей дважды.

-----Входные данные-----

В первой строке следуют два целых числа n и k (1 ≤ n ≤ 100, 1 ≤ k ≤ 10·n) — количество рядов мест в самолёте и количество пассажиров, которых нужно рассадить.

Далее следует описание рядов мест самолёта по одному ряду в строке. Если очередной символ равен '-', то это проход между рядами. Если очередной символ равен '.', то это свободное место. Если очередной символ равен 'S', то на текущем месте будет сидеть статусный пассажир. Если очередной символ равен 'P', то на текущем месте будет сидеть обычный пассажир.

Гарантируется, что количество свободных мест не меньше k. Гарантируется, что все ряды удовлетворяют описанному в условии формату.

-----Выходные данные-----

В первую строку выведите минимальное суммарное число соседей у статусных пассажиров.

Далее выведите план рассадки пассажиров, который минимизирует суммарное количество соседей у статусных пассажиров, в том же формате, что и во входных данных. Если в свободное место нужно посадить одного из k пассажиров, выведите строчную букву 'x' вместо символа '.'.

-----Примеры-----
Входные данные
1 2
SP.-SS.S-S.S

Выходные данные
5
SPx-SSxS-S.S

Входные данные
4 9
PP.-PPPS-S.S
PSP-PPSP-.S.
.S.-S..P-SS.
P.S-P.PP-PSP

Выходные данные
15
PPx-PPPS-S.S
PSP-PPSP-xSx
xSx-SxxP-SSx
P.S-PxPP-PSP

-----Примечание-----

В первом примере нужно посадить ещё двух обычных пассажиров. Для минимизации соседей у статусных пассажиров, нужно посадить первого из них на третье слева место, а второго на любое из оставшихся двух мест, так как независимо от выбора места он станет соседом двух статусных пассажиров.

Изначально, у статусного пассажира, который сидит на самом левом месте уже есть сосед. Также на четвёртом и пятом местах слева сидят статусные пассажиры, являющиеся соседями друг для друга (что добавляет к сумме 2).

Таким образом, после посадки ещё двух обычных пассажиров, итоговое суммарное количество соседей у статусных пассажиров станет равно пяти.


The Greatest Secret Ever consists of n words, indexed by positive integers from 1 to n. The secret needs dividing between k Keepers (let's index them by positive integers from 1 to k), the i-th Keeper gets a non-empty set of words with numbers from the set U_{i} = (u_{i}, 1, u_{i}, 2, ..., u_{i}, |U_{i}|). Here and below we'll presuppose that the set elements are written in the increasing order.

We'll say that the secret is safe if the following conditions are hold:  for any two indexes i, j (1 ≤ i < j ≤ k) the intersection of sets U_{i} and U_{j} is an empty set;  the union of sets U_1, U_2, ..., U_{k} is set (1, 2, ..., n);  in each set U_{i}, its elements u_{i}, 1, u_{i}, 2, ..., u_{i}, |U_{i}| do not form an arithmetic progression (in particular, |U_{i}| ≥ 3 should hold).

Let us remind you that the elements of set (u_1, u_2, ..., u_{s}) form an arithmetic progression if there is such number d, that for all i (1 ≤ i < s) fulfills u_{i} + d = u_{i} + 1. For example, the elements of sets (5), (1, 10) and (1, 5, 9) form arithmetic progressions and the elements of sets (1, 2, 4) and (3, 6, 8) don't.

Your task is to find any partition of the set of words into subsets U_1, U_2, ..., U_{k} so that the secret is safe. Otherwise indicate that there's no such partition.

-----Input-----

The input consists of a single line which contains two integers n and k (2 ≤ k ≤ n ≤ 10^6) — the number of words in the secret and the number of the Keepers. The numbers are separated by a single space.

-----Output-----

If there is no way to keep the secret safe, print a single integer "-1" (without the quotes). Otherwise, print n integers, the i-th of them representing the number of the Keeper who's got the i-th word of the secret.

If there are multiple solutions, print any of them.

-----Examples-----
Input
11 3

Output
3 1 2 1 1 2 3 2 2 3 1

Input
5 2

Output
-1


It's been almost a week since Polycarp couldn't get rid of insomnia. And as you may already know, one week in Berland lasts k days!

When Polycarp went to a doctor with his problem, the doctor asked him about his sleeping schedule (more specifically, the average amount of hours of sleep per week). Luckily, Polycarp kept records of sleep times for the last n days. So now he has a sequence a_1, a_2, ..., a_{n}, where a_{i} is the sleep time on the i-th day.

The number of records is so large that Polycarp is unable to calculate the average value by himself. Thus he is asking you to help him with the calculations. To get the average Polycarp is going to consider k consecutive days as a week. So there will be n - k + 1 weeks to take into consideration. For example, if k = 2, n = 3 and a = [3, 4, 7], then the result is $\frac{(3 + 4) +(4 + 7)}{2} = 9$.

You should write a program which will calculate average sleep times of Polycarp over all weeks.

-----Input-----

The first line contains two integer numbers n and k (1 ≤ k ≤ n ≤ 2·10^5).

The second line contains n integer numbers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^5).

-----Output-----

Output average sleeping time over all weeks.

The answer is considered to be correct if its absolute or relative error does not exceed 10^{ - 6}. In particular, it is enough to output real number with at least 6 digits after the decimal point.

-----Examples-----
Input
3 2
3 4 7

Output
9.0000000000

Input
1 1
10

Output
10.0000000000

Input
8 2
1 2 4 100000 123 456 789 1

Output
28964.2857142857

-----Note-----

In the third example there are n - k + 1 = 7 weeks, so the answer is sums of all weeks divided by 7.


There are n piles of pebbles on the table, the i-th pile contains a_{i} pebbles. Your task is to paint each pebble using one of the k given colors so that for each color c and any two piles i and j the difference between the number of pebbles of color c in pile i and number of pebbles of color c in pile j is at most one.

In other words, let's say that b_{i}, c is the number of pebbles of color c in the i-th pile. Then for any 1 ≤ c ≤ k, 1 ≤ i, j ≤ n the following condition must be satisfied |b_{i}, c - b_{j}, c| ≤ 1. It isn't necessary to use all k colors: if color c hasn't been used in pile i, then b_{i}, c is considered to be zero.

-----Input-----

The first line of the input contains positive integers n and k (1 ≤ n, k ≤ 100), separated by a space — the number of piles and the number of colors respectively.

The second line contains n positive integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 100) denoting number of pebbles in each of the piles.

-----Output-----

If there is no way to paint the pebbles satisfying the given condition, output "NO" (without quotes) .

Otherwise in the first line output "YES" (without quotes). Then n lines should follow, the i-th of them should contain a_{i} space-separated integers. j-th (1 ≤ j ≤ a_{i}) of these integers should be equal to the color of the j-th pebble in the i-th pile. If there are several possible answers, you may output any of them.

-----Examples-----
Input
4 4
1 2 3 4

Output
YES
1
1 4
1 2 4
1 2 3 4

Input
5 2
3 2 4 1 3

Output
NO

Input
5 4
3 2 4 3 5

Output
YES
1 2 3
1 3
1 2 3 4
1 3 4
1 1 2 3 4


Vasya became interested in bioinformatics. He's going to write an article about similar cyclic DNA sequences, so he invented a new method for determining the similarity of cyclic sequences.

Let's assume that strings s and t have the same length n, then the function h(s, t) is defined as the number of positions in which the respective symbols of s and t are the same. Function h(s, t) can be used to define the function of Vasya distance ρ(s, t): $\rho(s, t) = \sum_{i = 0}^{n - 1} \sum_{j = 0}^{n - 1} h(\operatorname{shift}(s, i), \operatorname{shift}(t, j))$ where $\operatorname{shift}(s, i)$ is obtained from string s, by applying left circular shift i times. For example, ρ("AGC", "CGT") =  h("AGC", "CGT") + h("AGC", "GTC") + h("AGC", "TCG") +  h("GCA", "CGT") + h("GCA", "GTC") + h("GCA", "TCG") +  h("CAG", "CGT") + h("CAG", "GTC") + h("CAG", "TCG") =  1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 1 = 6

Vasya found a string s of length n on the Internet. Now he wants to count how many strings t there are such that the Vasya distance from the string s attains maximum possible value. Formally speaking, t must satisfy the equation: $\rho(s, t) = \operatorname{max}_{u :|u|=|s|} \rho(s, u)$.

Vasya could not try all possible strings to find an answer, so he needs your help. As the answer may be very large, count the number of such strings modulo 10^9 + 7.

-----Input-----

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

The second line of the input contains a single string of length n, consisting of characters "ACGT".

-----Output-----

Print a single number — the answer modulo 10^9 + 7.

-----Examples-----
Input
1
C

Output
1

Input
2
AG

Output
4

Input
3
TTT

Output
1

-----Note-----

Please note that if for two distinct strings t_1 and t_2 values ρ(s, t_1) и ρ(s, t_2) are maximum among all possible t, then both strings must be taken into account in the answer even if one of them can be obtained by a circular shift of another one.

In the first sample, there is ρ("C", "C") = 1, for the remaining strings t of length 1 the value of ρ(s, t) is 0.

In the second sample, ρ("AG", "AG") = ρ("AG", "GA") = ρ("AG", "AA") = ρ("AG", "GG") = 4.

In the third sample, ρ("TTT", "TTT") = 27


Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm  ×  h mm sheet of glass, a diamond glass cutter and lots of enthusiasm. What he lacks is understanding of what to carve and how.

In order not to waste time, he decided to practice the technique of carving. To do this, he makes vertical and horizontal cuts through the entire sheet. This process results in making smaller rectangular fragments of glass. Leonid does not move the newly made glass fragments. In particular, a cut divides each fragment of glass that it goes through into smaller fragments.

After each cut Leonid tries to determine what area the largest of the currently available glass fragments has. Since there appear more and more fragments, this question takes him more and more time and distracts him from the fascinating process.

Leonid offers to divide the labor — he will cut glass, and you will calculate the area of the maximum fragment after each cut. Do you agree?

-----Input-----

The first line contains three integers w, h, n (2 ≤ w, h ≤ 200 000, 1 ≤ n ≤ 200 000).

Next n lines contain the descriptions of the cuts. Each description has the form H y or V x. In the first case Leonid makes the horizontal cut at the distance y millimeters (1 ≤ y ≤ h - 1) from the lower edge of the original sheet of glass. In the second case Leonid makes a vertical cut at distance x (1 ≤ x ≤ w - 1) millimeters from the left edge of the original sheet of glass. It is guaranteed that Leonid won't make two identical cuts.

-----Output-----

After each cut print on a single line the area of the maximum available glass fragment in mm^2.

-----Examples-----
Input
4 3 4
H 2
V 2
V 3
V 1

Output
8
4
4
2

Input
7 6 5
H 4
V 3
V 5
H 2
V 1

Output
28
16
12
6
4

-----Note-----

Picture for the first sample test:  [Image]  Picture for the second sample test:  $\square$


The Fair Nut found a string $s$. The string consists of lowercase Latin letters. The Nut is a curious guy, so he wants to find the number of strictly increasing sequences $p_1, p_2, \ldots, p_k$, such that:   For each $i$ ($1 \leq i \leq k$), $s_{p_i} =$ 'a'.  For each $i$ ($1 \leq i < k$), there is such $j$ that $p_i < j < p_{i + 1}$ and $s_j =$ 'b'.

The Nut is upset because he doesn't know how to find the number. Help him.

This number should be calculated modulo $10^9 + 7$.

-----Input-----

The first line contains the string $s$ ($1 \leq |s| \leq 10^5$) consisting of lowercase Latin letters.

-----Output-----

In a single line print the answer to the problem — the number of such sequences $p_1, p_2, \ldots, p_k$ modulo $10^9 + 7$.

-----Examples-----
Input
abbaa

Output
5
Input
baaaa

Output
4
Input
agaa

Output
3

-----Note-----

In the first example, there are $5$ possible sequences. $[1]$, $[4]$, $[5]$, $[1, 4]$, $[1, 5]$.

In the second example, there are $4$ possible sequences. $[2]$, $[3]$, $[4]$, $[5]$.

In the third example, there are $3$ possible sequences. $[1]$, $[3]$, $[4]$.


Takahashi has two integers X and Y.
He computed X + Y and X - Y, and the results were A and B, respectively.
Now he cannot remember what X and Y were. Find X and Y for him.

-----Constraints-----
 - -100 \leq A, B \leq 100
 - For the given integers A and B, there uniquely exist integers X and Y such that X + Y = A and X - Y = B.
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
A B

-----Output-----
Print X and Y.

-----Sample Input-----
2 -2

-----Sample Output-----
0 2

If X = 0 and Y = 2, they match the situation: 0 + 2 = 2 and 0 - 2 = -2.


There are two 100-story buildings, called A and B. (In this problem, the ground floor is called the first floor.)
For each i = 1,\dots, 100, the i-th floor of A and that of B are connected by a corridor.
Also, for each i = 1,\dots, 99, there is a corridor that connects the (i+1)-th floor of A and the i-th floor of B.
You can traverse each of those corridors in both directions, and it takes you x minutes to get to the other end.
Additionally, both of the buildings have staircases. For each i = 1,\dots, 99, a staircase connects the i-th and (i+1)-th floors of a building, and you need y minutes to get to an adjacent floor by taking the stairs.
Find the minimum time needed to reach the b-th floor of B from the a-th floor of A.

-----Constraints-----
 - 1 \leq a,b,x,y \leq 100
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
a b x y

-----Output-----
Print the minimum time needed to reach the b-th floor of B from the a-th floor of A.

-----Sample Input-----
2 1 1 5

-----Sample Output-----
1

There is a corridor that directly connects the 2-nd floor of A and the 1-st floor of B, so you can travel between them in 1 minute.
This is the fastest way to get there, since taking the stairs just once costs you 5 minutes.


Arkady's morning seemed to be straight of his nightmare. He overslept through the whole morning and, still half-asleep, got into the tram that arrived the first. Some time after, leaving the tram, he realized that he was not sure about the line number of the tram he was in.

During his ride, Arkady woke up several times and each time he saw the tram stopping at some stop. For each stop he knows which lines of tram stop there. Given this information, can you help Arkady determine what are the possible lines of the tram he was in?

-----Input-----

The first line contains a single integer $n$ ($2 \le n \le 100$) — the number of stops Arkady saw.

The next $n$ lines describe the stops. Each of them starts with a single integer $r$ ($1 \le r \le 100$) — the number of tram lines that stop there. $r$ distinct integers follow, each one between $1$ and $100$, inclusive, — the line numbers. They can be in arbitrary order.

It is guaranteed that Arkady's information is consistent, i.e. there is at least one tram line that Arkady could take.

-----Output-----

Print all tram lines that Arkady could be in, in arbitrary order.

-----Examples-----
Input
3
3 1 4 6
2 1 4
5 10 5 6 4 1

Output
1 4

Input
5
1 1
10 10 9 8 7 100 5 4 3 99 1
5 1 2 3 4 5
5 4 1 3 2 5
4 10 1 5 3

Output
1

-----Note-----

Consider the first example. Arkady woke up three times. The first time he saw a stop with lines $1$, $4$, $6$. The second time he saw a stop with lines $1$, $4$. The third time he saw a stop with lines $10$, $5$, $6$, $4$ and $1$. He can be in a tram of one of two lines: $1$ or $4$.


You will receive 5 points for solving this problem.

Manao has invented a new operation on strings that is called folding. Each fold happens between a pair of consecutive letters and places the second part of the string above first part, running in the opposite direction and aligned to the position of the fold. Using this operation, Manao converts the string into a structure that has one more level than there were fold operations performed. See the following examples for clarity.

We will denote the positions of folds with '|' characters. For example, the word "ABRACADABRA" written as "AB|RACA|DAB|RA" indicates that it has been folded three times: first, between the leftmost pair of 'B' and 'R' letters; second, between 'A' and 'D'; and third, between the rightmost pair of 'B' and 'R' letters. Here are several examples of folded strings:

"ABCDEF|GHIJK" |  "A|BCDEFGHIJK" |  "AB|RACA|DAB|RA" |  "X|XXXXX|X|X|XXXXXX"

               |                 |                   |       XXXXXX

    KJIHG      |   KJIHGFEDCB    |      AR           |       X

   ABCDEF      |            A    |     DAB           |       X

               |                 |     ACAR          |       XXXXX

               |                 |       AB          |           X

One last example for "ABCD|EFGH|IJ|K":

 K

IJ

HGFE

ABCD

Manao noticed that each folded string can be viewed as several piles of letters. For instance, in the previous example, there are four piles, which can be read as "AHI", "BGJK", "CF", and "DE" from bottom to top. Manao wonders what is the highest pile of identical letters he can build using fold operations on a given word. Note that the pile should not contain gaps and should start at the bottom level. For example, in the rightmost of the four examples above, none of the piles would be considered valid since each of them has gaps, starts above the bottom level, or both.

-----Input-----

The input will consist of one line containing a single string of n characters with 1 ≤ n ≤ 1000 and no spaces. All characters of the string will be uppercase letters.

This problem doesn't have subproblems. You will get 5 points for the correct submission.

-----Output-----

Print a single integer — the size of the largest pile composed of identical characters that can be seen in a valid result of folding operations on the given string.

-----Examples-----
Input
ABRACADABRA

Output
3

Input
ABBBCBDB

Output
3

Input
AB

Output
1

-----Note-----

Consider the first example. Manao can create a pile of three 'A's using the folding "AB|RACAD|ABRA", which results in the following structure:

ABRA

DACAR

   AB

In the second example, Manao can create a pile of three 'B's using the following folding: "AB|BB|CBDB".

CBDB

BB

AB

Another way for Manao to create a pile of three 'B's with "ABBBCBDB" is the following folding: "AB|B|BCBDB".

 BCBDB

 B

AB

In the third example, there are no folds performed and the string is just written in one line.