Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.

Once he thought about a string of length n consisting of zeroes and ones. Consider the following operation: we choose any two adjacent positions in the string, and if one them contains 0, and the other contains 1, then we are allowed to remove these two digits from the string, obtaining a string of length n - 2 as a result.

Now Andreid thinks about what is the minimum length of the string that can remain after applying the described operation several times (possibly, zero)? Help him to calculate this number.

-----Input-----

First line of the input contains a single integer n (1 ≤ n ≤ 2·10^5), the length of the string that Andreid has.

The second line contains the string of length n consisting only from zeros and ones.

-----Output-----

Output the minimum length of the string that may remain after applying the described operations several times.

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

Output
0

Input
5
01010

Output
1

Input
8
11101111

Output
6

-----Note-----

In the first sample test it is possible to change the string like the following: $1100 \rightarrow 10 \rightarrow(\text{empty})$.

In the second sample test it is possible to change the string like the following: $01010 \rightarrow 010 \rightarrow 0$.

In the third sample test it is possible to change the string like the following: $11101111 \rightarrow 111111$.


Reforms continue entering Berland. For example, during yesterday sitting the Berland Parliament approved as much as n laws (each law has been assigned a unique number from 1 to n). Today all these laws were put on the table of the President of Berland, G.W. Boosch, to be signed.

This time mr. Boosch plans to sign 2k laws. He decided to choose exactly two non-intersecting segments of integers from 1 to n of length k and sign all laws, whose numbers fall into these segments. More formally, mr. Boosch is going to choose two integers a, b (1 ≤ a ≤ b ≤ n - k + 1, b - a ≥ k) and sign all laws with numbers lying in the segments [a; a + k - 1] and [b; b + k - 1] (borders are included).

As mr. Boosch chooses the laws to sign, he of course considers the public opinion. Allberland Public Opinion Study Centre (APOSC) conducted opinion polls among the citizens, processed the results into a report and gave it to the president. The report contains the absurdity value for each law, in the public opinion. As mr. Boosch is a real patriot, he is keen on signing the laws with the maximum total absurdity. Help him.

-----Input-----

The first line contains two integers n and k (2 ≤ n ≤ 2·10^5, 0 < 2k ≤ n) — the number of laws accepted by the parliament and the length of one segment in the law list, correspondingly. The next line contains n integers x_1, x_2, ..., x_{n} — the absurdity of each law (1 ≤ x_{i} ≤ 10^9).

-----Output-----

Print two integers a, b — the beginning of segments that mr. Boosch should choose. That means that the president signs laws with numbers from segments [a; a + k - 1] and [b; b + k - 1]. If there are multiple solutions, print the one with the minimum number a. If there still are multiple solutions, print the one with the minimum b.

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

Output
1 4

Input
6 2
1 1 1 1 1 1

Output
1 3

-----Note-----

In the first sample mr. Boosch signs laws with numbers from segments [1;2] and [4;5]. The total absurdity of the signed laws equals 3 + 6 + 1 + 6 = 16.

In the second sample mr. Boosch signs laws with numbers from segments [1;2] and [3;4]. The total absurdity of the signed laws equals 1 + 1 + 1 + 1 = 4.


You are given array $a$ of length $n$. You can choose one segment $[l, r]$ ($1 \le l \le r \le n$) and integer value $k$ (positive, negative or even zero) and change $a_l, a_{l + 1}, \dots, a_r$ by $k$ each (i.e. $a_i := a_i + k$ for each $l \le i \le r$).

What is the maximum possible number of elements with value $c$ that can be obtained after one such operation?

-----Input-----

The first line contains two integers $n$ and $c$ ($1 \le n \le 5 \cdot 10^5$, $1 \le c \le 5 \cdot 10^5$) — the length of array and the value $c$ to obtain.

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 5 \cdot 10^5$) — array $a$.

-----Output-----

Print one integer — the maximum possible number of elements with value $c$ which can be obtained after performing operation described above.

-----Examples-----
Input
6 9
9 9 9 9 9 9

Output
6

Input
3 2
6 2 6

Output
2

-----Note-----

In the first example we can choose any segment and $k = 0$. The array will stay same.

In the second example we can choose segment $[1, 3]$ and $k = -4$. The array will become $[2, -2, 2]$.


You are solving the crossword problem K from IPSC 2014. You solved all the clues except for one: who does Eevee evolve into? You are not very into pokemons, but quick googling helped you find out, that Eevee can evolve into eight different pokemons: Vaporeon, Jolteon, Flareon, Espeon, Umbreon, Leafeon, Glaceon, and Sylveon.

You know the length of the word in the crossword, and you already know some letters. Designers of the crossword made sure that the answer is unambiguous, so you can assume that exactly one pokemon out of the 8 that Eevee evolves into fits the length and the letters given. Your task is to find it.

-----Input-----

First line contains an integer n (6 ≤ n ≤ 8) – the length of the string.

Next line contains a string consisting of n characters, each of which is either a lower case english letter (indicating a known letter) or a dot character (indicating an empty cell in the crossword).

-----Output-----

Print a name of the pokemon that Eevee can evolve into that matches the pattern in the input. Use lower case letters only to print the name (in particular, do not capitalize the first letter).

-----Examples-----
Input
7
j......

Output
jolteon

Input
7
...feon

Output
leafeon

Input
7
.l.r.o.

Output
flareon

-----Note-----

Here's a set of names in a form you can paste into your solution:

["vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"]

{"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"}


Levko loves permutations very much. A permutation of length n is a sequence of distinct positive integers, each is at most n.

Let’s assume that value gcd(a, b) shows the greatest common divisor of numbers a and b. Levko assumes that element p_{i} of permutation p_1, p_2, ... , p_{n} is good if gcd(i, p_{i}) > 1. Levko considers a permutation beautiful, if it has exactly k good elements. Unfortunately, he doesn’t know any beautiful permutation. Your task is to help him to find at least one of them.

-----Input-----

The single line contains two integers n and k (1 ≤ n ≤ 10^5, 0 ≤ k ≤ n).

-----Output-----

In a single line print either any beautiful permutation or -1, if such permutation doesn’t exist.

If there are multiple suitable permutations, you are allowed to print any of them.

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

Output
2 4 3 1
Input
1 1

Output
-1

-----Note-----

In the first sample elements 4 and 3 are good because gcd(2, 4) = 2 > 1 and gcd(3, 3) = 3 > 1. Elements 2 and 1 are not good because gcd(1, 2) = 1 and gcd(4, 1) = 1. As there are exactly 2 good elements, the permutation is beautiful.

The second sample has no beautiful permutations.


Little X and Little Z are good friends. They always chat online. But both of them have schedules.

Little Z has fixed schedule. He always online at any moment of time between a_1 and b_1, between a_2 and b_2, ..., between a_{p} and b_{p} (all borders inclusive). But the schedule of Little X is quite strange, it depends on the time when he gets up. If he gets up at time 0, he will be online at any moment of time between c_1 and d_1, between c_2 and d_2, ..., between c_{q} and d_{q} (all borders inclusive). But if he gets up at time t, these segments will be shifted by t. They become [c_{i} + t, d_{i} + t] (for all i).

If at a moment of time, both Little X and Little Z are online simultaneosly, they can chat online happily. You know that Little X can get up at an integer moment of time between l and r (both borders inclusive). Also you know that Little X wants to get up at the moment of time, that is suitable for chatting with Little Z (they must have at least one common moment of time in schedules). How many integer moments of time from the segment [l, r] suit for that?

-----Input-----

The first line contains four space-separated integers p, q, l, r (1 ≤  p, q ≤ 50; 0 ≤ l ≤ r ≤ 1000).

Each of the next p lines contains two space-separated integers a_{i}, b_{i} (0 ≤ a_{i} < b_{i} ≤ 1000). Each of the next q lines contains two space-separated integers c_{j}, d_{j} (0 ≤ c_{j} < d_{j} ≤ 1000).

It's guaranteed that b_{i} < a_{i} + 1 and d_{j} < c_{j} + 1 for all valid i and j.

-----Output-----

Output a single integer — the number of moments of time from the segment [l, r] which suit for online conversation.

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

Output
3

Input
2 3 0 20
15 17
23 26
1 4
7 11
15 17

Output
20


Two bears are playing tic-tac-toe via mail. It's boring for them to play usual tic-tac-toe game, so they are a playing modified version of this game. Here are its rules.

The game is played on the following field. [Image]

Players are making moves by turns. At first move a player can put his chip in any cell of any small field. For following moves, there are some restrictions: if during last move the opposite player put his chip to cell with coordinates (x_{l}, y_{l}) in some small field, the next move should be done in one of the cells of the small field with coordinates (x_{l}, y_{l}). For example, if in the first move a player puts his chip to lower left cell of central field, then the second player on his next move should put his chip into some cell of lower left field (pay attention to the first test case). If there are no free cells in the required field, the player can put his chip to any empty cell on any field.

You are given current state of the game and coordinates of cell in which the last move was done. You should find all cells in which the current player can put his chip.

A hare works as a postman in the forest, he likes to foul bears. Sometimes he changes the game field a bit, so the current state of the game could be unreachable. However, after his changes the cell where the last move was done is not empty. You don't need to find if the state is unreachable or not, just output possible next moves according to the rules.

-----Input-----

First 11 lines contains descriptions of table with 9 rows and 9 columns which are divided into 9 small fields by spaces and empty lines. Each small field is described by 9 characters without spaces and empty lines. character "x" (ASCII-code 120) means that the cell is occupied with chip of the first player, character "o" (ASCII-code 111) denotes a field occupied with chip of the second player, character "." (ASCII-code 46) describes empty cell.

The line after the table contains two integers x and y (1 ≤ x, y ≤ 9). They describe coordinates of the cell in table where the last move was done. Rows in the table are numbered from up to down and columns are numbered from left to right.

It's guaranteed that cell where the last move was done is filled with "x" or "o". Also, it's guaranteed that there is at least one empty cell. It's not guaranteed that current state of game is reachable.

-----Output-----

Output the field in same format with characters "!" (ASCII-code 33) on positions where the current player can put his chip. All other cells should not be modified.

-----Examples-----
Input
... ... ...
... ... ...
... ... ...

... ... ...
... ... ...
... x.. ...

... ... ...
... ... ...
... ... ...
6 4

Output
... ... ...
... ... ...
... ... ...

... ... ...
... ... ...
... x.. ...

!!! ... ...
!!! ... ...
!!! ... ...

Input
xoo x.. x..
ooo ... ...
ooo ... ...

x.. x.. x..
... ... ...
... ... ...

x.. x.. x..
... ... ...
... ... ...
7 4

Output
xoo x!! x!!
ooo !!! !!!
ooo !!! !!!

x!! x!! x!!
!!! !!! !!!
!!! !!! !!!

x!! x!! x!!
!!! !!! !!!
!!! !!! !!!

Input
o.. ... ...
... ... ...
... ... ...

... xxx ...
... xox ...
... ooo ...

... ... ...
... ... ...
... ... ...
5 5

Output
o!! !!! !!!
!!! !!! !!!
!!! !!! !!!

!!! xxx !!!
!!! xox !!!
!!! ooo !!!

!!! !!! !!!
!!! !!! !!!
!!! !!! !!!

-----Note-----

In the first test case the first player made a move to lower left cell of central field, so the second player can put a chip only to cells of lower left field.

In the second test case the last move was done to upper left cell of lower central field, however all cells in upper left field are occupied, so the second player can put his chip to any empty cell.

In the third test case the last move was done to central cell of central field, so current player can put his chip to any cell of central field, which is already occupied, so he can move anywhere. Pay attention that this state of the game is unreachable.


The new "Die Hard" movie has just been released! There are n people at the cinema box office standing in a huge line. Each of them has a single 100, 50 or 25 ruble bill. A "Die Hard" ticket costs 25 rubles. Can the booking clerk sell a ticket to each person and give the change if he initially has no money and sells the tickets strictly in the order people follow in the line?

-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5) — the number of people in the line. The next line contains n integers, each of them equals 25, 50 or 100 — the values of the bills the people have. The numbers are given in the order from the beginning of the line (at the box office) to the end of the line.

-----Output-----

Print "YES" (without the quotes) if the booking clerk can sell a ticket to each person and give the change. Otherwise print "NO".

-----Examples-----
Input
4
25 25 50 50

Output
YES

Input
2
25 100

Output
NO

Input
4
50 50 25 25

Output
NO


Peter has a sequence of integers a_1, a_2, ..., a_{n}. Peter wants all numbers in the sequence to equal h. He can perform the operation of "adding one on the segment [l, r]": add one to all elements of the sequence with indices from l to r (inclusive). At that, Peter never chooses any element as the beginning of the segment twice. Similarly, Peter never chooses any element as the end of the segment twice. In other words, for any two segments [l_1, r_1] and [l_2, r_2], where Peter added one, the following inequalities hold: l_1 ≠ l_2 and r_1 ≠ r_2.

How many distinct ways are there to make all numbers in the sequence equal h? Print this number of ways modulo 1000000007 (10^9 + 7). Two ways are considered distinct if one of them has a segment that isn't in the other way.

-----Input-----

The first line contains two integers n, h (1 ≤ n, h ≤ 2000). The next line contains n integers a_1, a_2, ..., a_{n} (0 ≤ a_{i} ≤ 2000).

-----Output-----

Print a single integer — the answer to the problem modulo 1000000007 (10^9 + 7).

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

Output
4

Input
5 1
1 1 1 1 1

Output
1

Input
4 3
3 2 1 1

Output
0


Mahmoud and Ehab play a game called the even-odd game. Ehab chooses his favorite integer n and then they take turns, starting from Mahmoud. In each player's turn, he has to choose an integer a and subtract it from n such that:  1 ≤ a ≤ n.  If it's Mahmoud's turn, a has to be even, but if it's Ehab's turn, a has to be odd.

If the current player can't choose any number satisfying the conditions, he loses. Can you determine the winner if they both play optimally?

-----Input-----

The only line contains an integer n (1 ≤ n ≤ 10^9), the number at the beginning of the game.

-----Output-----

Output "Mahmoud" (without quotes) if Mahmoud wins and "Ehab" (without quotes) otherwise.

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

Output
Ehab
Input
2

Output
Mahmoud

-----Note-----

In the first sample, Mahmoud can't choose any integer a initially because there is no positive even integer less than or equal to 1 so Ehab wins.

In the second sample, Mahmoud has to choose a = 2 and subtract it from n. It's Ehab's turn and n = 0. There is no positive odd integer less than or equal to 0 so Mahmoud wins.


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

For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters of t. The strings s and t are isomorphic if their lengths are equal and there is a one-to-one mapping (bijection) f between S and T for which f(s_{i}) = t_{i}. Formally:  f(s_{i}) = t_{i} for any index i,  for any character $x \in S$ there is exactly one character $y \in T$ that f(x) = y,  for any character $y \in T$ there is exactly one character $x \in S$ that f(x) = y.

For example, the strings "aababc" and "bbcbcz" are isomorphic. Also the strings "aaaww" and "wwwaa" are isomorphic. The following pairs of strings are not isomorphic: "aab" and "bbb", "test" and "best".

You have to handle m queries characterized by three integers x, y, len (1 ≤ x, y ≤ n - len + 1). For each query check if two substrings s[x... x + len - 1] and s[y... y + len - 1] are isomorphic.

-----Input-----

The first line contains two space-separated integers n and m (1 ≤ n ≤ 2·10^5, 1 ≤ m ≤ 2·10^5) — the length of the string s and the number of queries.

The second line contains string s consisting of n lowercase English letters.

The following m lines contain a single query on each line: x_{i}, y_{i} and len_{i} (1 ≤ x_{i}, y_{i} ≤ n, 1 ≤ len_{i} ≤ n - max(x_{i}, y_{i}) + 1) — the description of the pair of the substrings to check.

-----Output-----

For each query in a separate line print "YES" if substrings s[x_{i}... x_{i} + len_{i} - 1] and s[y_{i}... y_{i} + len_{i} - 1] are isomorphic and "NO" otherwise.

-----Example-----
Input
7 4
abacaba
1 1 1
1 4 2
2 1 3
2 4 3

Output
YES
YES
NO
YES

-----Note-----

The queries in the example are following:   substrings "a" and "a" are isomorphic: f(a) = a;  substrings "ab" and "ca" are isomorphic: f(a) = c, f(b) = a;  substrings "bac" and "aba" are not isomorphic since f(b) and f(c) must be equal to a at same time;  substrings "bac" and "cab" are isomorphic: f(b) = c, f(a) = a, f(c) = b.


Vadim is really keen on travelling. Recently he heard about kayaking activity near his town and became very excited about it, so he joined a party of kayakers.

Now the party is ready to start its journey, but firstly they have to choose kayaks. There are 2·n people in the group (including Vadim), and they have exactly n - 1 tandem kayaks (each of which, obviously, can carry two people) and 2 single kayaks. i-th person's weight is w_{i}, and weight is an important matter in kayaking — if the difference between the weights of two people that sit in the same tandem kayak is too large, then it can crash. And, of course, people want to distribute their seats in kayaks in order to minimize the chances that kayaks will crash.

Formally, the instability of a single kayak is always 0, and the instability of a tandem kayak is the absolute difference between weights of the people that are in this kayak. Instability of the whole journey is the total instability of all kayaks.

Help the party to determine minimum possible total instability!

-----Input-----

The first line contains one number n (2 ≤ n ≤ 50).

The second line contains 2·n integer numbers w_1, w_2, ..., w_2n, where w_{i} is weight of person i (1 ≤ w_{i} ≤ 1000).

-----Output-----

Print minimum possible total instability.

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

Output
1

Input
4
1 3 4 6 3 4 100 200

Output
5


Little Petya likes arrays that consist of non-negative integers a lot. Recently his mom has presented him one such array consisting of n elements. Petya immediately decided to find there a segment of consecutive elements, such that the xor of all numbers from this segment was maximal possible. Help him with that.

The xor operation is the bitwise exclusive "OR", that is denoted as "xor" in Pascal and "^" in C/C++/Java.

-----Input-----

The first line contains integer n (1 ≤ n ≤ 100) — the number of elements in the array. The second line contains the space-separated integers from the array. All numbers are non-negative integers strictly less than 2^30.

-----Output-----

Print a single integer — the required maximal xor of a segment of consecutive elements.

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

Output
3

Input
3
1 2 7

Output
7

Input
4
4 2 4 8

Output
14

-----Note-----

In the first sample one of the optimal segments is the segment that consists of the first and the second array elements, if we consider the array elements indexed starting from one.

The second sample contains only one optimal segment, which contains exactly one array element (element with index three).


The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any two of them are connected by an edge in graph G. Sounds simple, doesn't it? Nobody yet knows an algorithm that finds a solution to this problem in polynomial time of the size of the graph. However, as with many other NP-complete problems, the clique problem is easier if you consider a specific type of a graph.

Consider n distinct points on a line. Let the i-th point have the coordinate x_{i} and weight w_{i}. Let's form graph G, whose vertices are these points and edges connect exactly the pairs of points (i, j), such that the distance between them is not less than the sum of their weights, or more formally: |x_{i} - x_{j}| ≥ w_{i} + w_{j}.

Find the size of the maximum clique in such graph.

-----Input-----

The first line contains the integer n (1 ≤ n ≤ 200 000) — the number of points.

Each of the next n lines contains two numbers x_{i}, w_{i} (0 ≤ x_{i} ≤ 10^9, 1 ≤ w_{i} ≤ 10^9) — the coordinate and the weight of a point. All x_{i} are different.

-----Output-----

Print a single number — the number of vertexes in the maximum clique of the given graph.

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

Output
3

-----Note-----

If you happen to know how to solve this problem without using the specific properties of the graph formulated in the problem statement, then you are able to get a prize of one million dollars!

The picture for the sample test. [Image]


Polycarpus has got n candies and m friends (n ≥ m). He wants to make a New Year present with candies to each friend. Polycarpus is planning to present all candies and he wants to do this in the fairest (that is, most equal) manner. He wants to choose such a_{i}, where a_{i} is the number of candies in the i-th friend's present, that the maximum a_{i} differs from the least a_{i} as little as possible.

For example, if n is divisible by m, then he is going to present the same number of candies to all his friends, that is, the maximum a_{i} won't differ from the minimum one.

-----Input-----

The single line of the input contains a pair of space-separated positive integers n, m (1 ≤ n, m ≤ 100;n ≥ m) — the number of candies and the number of Polycarpus's friends.

-----Output-----

Print the required sequence a_1, a_2, ..., a_{m}, where a_{i} is the number of candies in the i-th friend's present. All numbers a_{i} must be positive integers, total up to n, the maximum one should differ from the minimum one by the smallest possible value.

-----Examples-----
Input
12 3

Output
4 4 4
Input
15 4

Output
3 4 4 4
Input
18 7

Output
2 2 2 3 3 3 3

-----Note-----

Print a_{i} in any order, separate the numbers by spaces.


Two players play a simple game. Each player is provided with a box with balls. First player's box contains exactly n_1 balls and second player's box contains exactly n_2 balls. In one move first player can take from 1 to k_1 balls from his box and throw them away. Similarly, the second player can take from 1 to k_2 balls from his box in his move. Players alternate turns and the first player starts the game. The one who can't make a move loses. Your task is to determine who wins if both players play optimally.

-----Input-----

The first line contains four integers n_1, n_2, k_1, k_2. All numbers in the input are from 1 to 50.

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

-----Output-----

Output "First" if the first player wins and "Second" otherwise.

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

Output
Second

Input
2 1 1 1

Output
First

-----Note-----

Consider the first sample test. Each player has a box with 2 balls. The first player draws a single ball from his box in one move and the second player can either take 1 or 2 balls from his box in one move. No matter how the first player acts, the second player can always win if he plays wisely.


Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point $T$, which coordinates to be found out.

Bob travelled around the world and collected clues of the treasure location at $n$ obelisks. These clues were in an ancient language, and he has only decrypted them at home. Since he does not know which clue belongs to which obelisk, finding the treasure might pose a challenge. Can you help him?

As everyone knows, the world is a two-dimensional plane. The $i$-th obelisk is at integer coordinates $(x_i, y_i)$. The $j$-th clue consists of $2$ integers $(a_j, b_j)$ and belongs to the obelisk $p_j$, where $p$ is some (unknown) permutation on $n$ elements. It means that the treasure is located at $T=(x_{p_j} + a_j, y_{p_j} + b_j)$. This point $T$ is the same for all clues.

In other words, each clue belongs to exactly one of the obelisks, and each obelisk has exactly one clue that belongs to it. A clue represents the vector from the obelisk to the treasure. The clues must be distributed among the obelisks in such a way that they all point to the same position of the treasure.

Your task is to find the coordinates of the treasure. If there are multiple solutions, you may print any of them.

Note that you don't need to find the permutation. Permutations are used only in order to explain the problem.

-----Input-----

The first line contains an integer $n$ ($1 \leq n \leq 1000$) — the number of obelisks, that is also equal to the number of clues.

Each of the next $n$ lines contains two integers $x_i$, $y_i$ ($-10^6 \leq x_i, y_i \leq 10^6$) — the coordinates of the $i$-th obelisk. All coordinates are distinct, that is $x_i \neq x_j$ or $y_i \neq y_j$ will be satisfied for every $(i, j)$ such that $i \neq j$.

Each of the next $n$ lines contains two integers $a_i$, $b_i$ ($-2 \cdot 10^6 \leq a_i, b_i \leq 2 \cdot 10^6$) — the direction of the $i$-th clue. All coordinates are distinct, that is $a_i \neq a_j$ or $b_i \neq b_j$ will be satisfied for every $(i, j)$ such that $i \neq j$.

It is guaranteed that there exists a permutation $p$, such that for all $i,j$ it holds $\left(x_{p_i} + a_i, y_{p_i} + b_i\right) = \left(x_{p_j} + a_j, y_{p_j} + b_j\right)$.

-----Output-----

Output a single line containing two integers $T_x, T_y$ — the coordinates of the treasure.

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

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

Output
1 2

Input
4
2 2
8 2
-7 0
-2 6
1 -14
16 -12
11 -18
7 -14

Output
9 -12

-----Note-----

As $n = 2$, we can consider all permutations on two elements.

If $p = [1, 2]$, then the obelisk $(2, 5)$ holds the clue $(7, -2)$, which means that the treasure is hidden at $(9, 3)$. The second obelisk $(-6, 4)$ would give the clue $(-1,-3)$ and the treasure at $(-7, 1)$. However, both obelisks must give the same location, hence this is clearly not the correct permutation.

If the hidden permutation is $[2, 1]$, then the first clue belongs to the second obelisk and the second clue belongs to the first obelisk. Hence $(-6, 4) + (7, -2) = (2,5) + (-1,-3) = (1, 2)$, so $T = (1,2)$ is the location of the treasure. [Image]

In the second sample, the hidden permutation is $[2, 3, 4, 1]$.


Do you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a large queue of n Berland residents lined up in front of the ice cream stall. We know that each of them has a certain amount of berland dollars with them. The residents of Berland are nice people, so each person agrees to swap places with the person right behind him for just 1 dollar. More formally, if person a stands just behind person b, then person a can pay person b 1 dollar, then a and b get swapped. Of course, if person a has zero dollars, he can not swap places with person b.

Residents of Berland are strange people. In particular, they get upset when there is someone with a strictly smaller sum of money in the line in front of them.

Can you help the residents of Berland form such order in the line so that they were all happy? A happy resident is the one who stands first in the line or the one in front of who another resident stands with not less number of dollars. Note that the people of Berland are people of honor and they agree to swap places only in the manner described above.

-----Input-----

The first line contains integer n (1 ≤ n ≤ 200 000) — the number of residents who stand in the line.

The second line contains n space-separated integers a_{i} (0 ≤ a_{i} ≤ 10^9), where a_{i} is the number of Berland dollars of a man standing on the i-th position in the line. The positions are numbered starting from the end of the line.

-----Output-----

If it is impossible to make all the residents happy, print ":(" without the quotes. Otherwise, print in the single line n space-separated integers, the i-th of them must be equal to the number of money of the person on position i in the new line. If there are multiple answers, print any of them.

-----Examples-----
Input
2
11 8

Output
9 10
Input
5
10 9 7 10 6

Output
:(

Input
3
12 3 3

Output
4 4 10

-----Note-----

In the first sample two residents should swap places, after that the first resident has 10 dollars and he is at the head of the line and the second resident will have 9 coins and he will be at the end of the line.

In the second sample it is impossible to achieve the desired result.

In the third sample the first person can swap with the second one, then they will have the following numbers of dollars: 4 11 3, then the second person (in the new line) swaps with the third one, and the resulting numbers of dollars will equal to: 4 4 10. In this line everybody will be happy.


Given a string $s$ of length $n$ and integer $k$ ($1 \le k \le n$). The string $s$ has a level $x$, if $x$ is largest non-negative integer, such that it's possible to find in $s$:  $x$ non-intersecting (non-overlapping) substrings of length $k$,  all characters of these $x$ substrings are the same (i.e. each substring contains only one distinct character and this character is the same for all the substrings).

A substring is a sequence of consecutive (adjacent) characters, it is defined by two integers $i$ and $j$ ($1 \le i \le j \le n$), denoted as $s[i \dots j]$ = "$s_{i}s_{i+1} \dots s_{j}$".

For example, if $k = 2$, then:  the string "aabb" has level $1$ (you can select substring "aa"),  the strings "zzzz" and "zzbzz" has level $2$ (you can select two non-intersecting substrings "zz" in each of them),  the strings "abed" and "aca" have level $0$ (you can't find at least one substring of the length $k=2$ containing the only distinct character).

Zuhair gave you the integer $k$ and the string $s$ of length $n$. You need to find $x$, the level of the string $s$.

-----Input-----

The first line contains two integers $n$ and $k$ ($1 \le k \le n \le 2 \cdot 10^5$) — the length of the string and the value of $k$.

The second line contains the string $s$ of length $n$ consisting only of lowercase Latin letters.

-----Output-----

Print a single integer $x$ — the level of the string.

-----Examples-----
Input
8 2
aaacaabb

Output
2

Input
2 1
ab

Output
1

Input
4 2
abab

Output
0

-----Note-----

In the first example, we can select $2$ non-intersecting substrings consisting of letter 'a': "(aa)ac(aa)bb", so the level is $2$.

In the second example, we can select either substring "a" or "b" to get the answer $1$.


Arkady and his friends love playing checkers on an $n \times n$ field. The rows and the columns of the field are enumerated from $1$ to $n$.

The friends have recently won a championship, so Arkady wants to please them with some candies. Remembering an old parable (but not its moral), Arkady wants to give to his friends one set of candies per each cell of the field: the set of candies for cell $(i, j)$ will have exactly $(i^2 + j^2)$ candies of unique type.

There are $m$ friends who deserve the present. How many of these $n \times n$ sets of candies can be split equally into $m$ parts without cutting a candy into pieces? Note that each set has to be split independently since the types of candies in different sets are different.

-----Input-----

The only line contains two integers $n$ and $m$ ($1 \le n \le 10^9$, $1 \le m \le 1000$) — the size of the field and the number of parts to split the sets into.

-----Output-----

Print a single integer — the number of sets that can be split equally.

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

Output
1

Input
6 5

Output
13

Input
1000000000 1

Output
1000000000000000000

-----Note-----

In the first example, only the set for cell $(3, 3)$ can be split equally ($3^2 + 3^2 = 18$, which is divisible by $m=3$).

In the second example, the sets for the following cells can be divided equally:   $(1, 2)$ and $(2, 1)$, since $1^2 + 2^2 = 5$, which is divisible by $5$;  $(1, 3)$ and $(3, 1)$;  $(2, 4)$ and $(4, 2)$;  $(2, 6)$ and $(6, 2)$;  $(3, 4)$ and $(4, 3)$;  $(3, 6)$ and $(6, 3)$;  $(5, 5)$.

In the third example, sets in all cells can be divided equally, since $m = 1$.


Innovation technologies are on a victorious march around the planet. They integrate into all spheres of human activity!

A restaurant called "Dijkstra's Place" has started thinking about optimizing the booking system.

There are n booking requests received by now. Each request is characterized by two numbers: c_{i} and p_{i} — the size of the group of visitors who will come via this request and the total sum of money they will spend in the restaurant, correspondingly.

We know that for each request, all c_{i} people want to sit at the same table and are going to spend the whole evening in the restaurant, from the opening moment at 18:00 to the closing moment.

Unfortunately, there only are k tables in the restaurant. For each table, we know r_{i} — the maximum number of people who can sit at it. A table can have only people from the same group sitting at it. If you cannot find a large enough table for the whole group, then all visitors leave and naturally, pay nothing.

Your task is: given the tables and the requests, decide which requests to accept and which requests to decline so that the money paid by the happy and full visitors was maximum.

-----Input-----

The first line of the input contains integer n (1 ≤ n ≤ 1000) — the number of requests from visitors. Then n lines follow. Each line contains two integers: c_{i}, p_{i} (1 ≤ c_{i}, p_{i} ≤ 1000) — the size of the group of visitors who will come by the i-th request and the total sum of money they will pay when they visit the restaurant, correspondingly.

The next line contains integer k (1 ≤ k ≤ 1000) — the number of tables in the restaurant. The last line contains k space-separated integers: r_1, r_2, ..., r_{k} (1 ≤ r_{i} ≤ 1000) — the maximum number of people that can sit at each table.

-----Output-----

In the first line print two integers: m, s — the number of accepted requests and the total money you get from these requests, correspondingly.

Then print m lines — each line must contain two space-separated integers: the number of the accepted request and the number of the table to seat people who come via this request. The requests and the tables are consecutively numbered starting from 1 in the order in which they are given in the input.

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

-----Examples-----
Input
3
10 50
2 100
5 30
3
4 6 9

Output
2 130
2 1
3 2


Ayrat has number n, represented as it's prime factorization p_{i} of size m, i.e. n = p_1·p_2·...·p_{m}. Ayrat got secret information that that the product of all divisors of n taken modulo 10^9 + 7 is the password to the secret data base. Now he wants to calculate this value.

-----Input-----

The first line of the input contains a single integer m (1 ≤ m ≤ 200 000) — the number of primes in factorization of n.

The second line contains m primes numbers p_{i} (2 ≤ p_{i} ≤ 200 000).

-----Output-----

Print one integer — the product of all divisors of n modulo 10^9 + 7.

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

Output
36

Input
3
2 3 2

Output
1728

-----Note-----

In the first sample n = 2·3 = 6. The divisors of 6 are 1, 2, 3 and 6, their product is equal to 1·2·3·6 = 36.

In the second sample 2·3·2 = 12. The divisors of 12 are 1, 2, 3, 4, 6 and 12. 1·2·3·4·6·12 = 1728.


Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to make his birthday cake weird!

The cake is a n × n square consisting of equal squares with side length 1. Each square is either empty or consists of a single chocolate. They bought the cake and randomly started to put the chocolates on the cake. The value of Famil Door's happiness will be equal to the number of pairs of cells with chocolates that are in the same row or in the same column of the cake. Famil Doors's family is wondering what is the amount of happiness of Famil going to be?

Please, note that any pair can be counted no more than once, as two different cells can't share both the same row and the same column.

-----Input-----

In the first line of the input, you are given a single integer n (1 ≤ n ≤ 100) — the length of the side of the cake.

Then follow n lines, each containing n characters. Empty cells are denoted with '.', while cells that contain chocolates are denoted by 'C'.

-----Output-----

Print the value of Famil Door's happiness, i.e. the number of pairs of chocolate pieces that share the same row or the same column.

-----Examples-----
Input
3
.CC
C..
C.C

Output
4

Input
4
CC..
C..C
.CC.
.CC.

Output
9

-----Note-----

If we number rows from top to bottom and columns from left to right, then, pieces that share the same row in the first sample are:   (1, 2) and (1, 3)  (3, 1) and (3, 3)  Pieces that share the same column are:   (2, 1) and (3, 1)  (1, 3) and (3, 3)


One day n friends met at a party, they hadn't seen each other for a long time and so they decided to make a group photo together.

Simply speaking, the process of taking photos can be described as follows. On the photo, each photographed friend occupies a rectangle of pixels: the i-th of them occupies the rectangle of width w_{i} pixels and height h_{i} pixels. On the group photo everybody stands in a line, thus the minimum pixel size of the photo including all the photographed friends, is W × H, where W is the total sum of all widths and H is the maximum height of all the photographed friends.

As is usually the case, the friends made n photos — the j-th (1 ≤ j ≤ n) photo had everybody except for the j-th friend as he was the photographer.

Print the minimum size of each made photo in pixels.

-----Input-----

The first line contains integer n (2 ≤ n ≤ 200 000) — the number of friends.

Then n lines follow: the i-th line contains information about the i-th friend. The line contains a pair of integers w_{i}, h_{i} (1 ≤ w_{i} ≤ 10, 1 ≤ h_{i} ≤ 1000) — the width and height in pixels of the corresponding rectangle.

-----Output-----

Print n space-separated numbers b_1, b_2, ..., b_{n}, where b_{i} — the total number of pixels on the minimum photo containing all friends expect for the i-th one.

-----Examples-----
Input
3
1 10
5 5
10 1

Output
75 110 60
Input
3
2 1
1 2
2 1

Output
6 4 6


Sasha and Ira are two best friends. But they aren’t just friends, they are software engineers and experts in artificial intelligence. They are developing an algorithm for two bots playing a two-player game. The game is cooperative and turn based. In each turn, one of the players makes a move (it doesn’t matter which player, it's possible that players turns do not alternate).

Algorithm for bots that Sasha and Ira are developing works by keeping track of the state the game is in. Each time either bot makes a move, the state changes. And, since the game is very dynamic, it will never go back to the state it was already in at any point in the past.

Sasha and Ira are perfectionists and want their algorithm to have an optimal winning strategy. They have noticed that in the optimal winning strategy, both bots make exactly N moves each. But, in order to find the optimal strategy, their algorithm needs to analyze all possible states of the game (they haven’t learned about alpha-beta pruning yet) and pick the best sequence of moves.

They are worried about the efficiency of their algorithm and are wondering what is the total number of states of the game that need to be analyzed?

-----Input-----

The first and only line contains integer N.  1 ≤ N ≤ 10^6

-----Output-----

Output should contain a single integer – number of possible states modulo 10^9 + 7.

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

Output
19

-----Note-----

Start: Game is in state A.   Turn 1: Either bot can make a move (first bot is red and second bot is blue), so there are two possible states after the first turn – B and C.  Turn 2: In both states B and C, either bot can again make a turn, so the list of possible states is expanded to include D, E, F and G.  Turn 3: Red bot already did N=2 moves when in state D, so it cannot make any more moves there. It can make moves when in state E, F and G, so states I, K and M are added to the list. Similarly, blue bot cannot make a move when in state G, but can when in D, E and F, so states H, J and L are added.  Turn 4: Red bot already did N=2 moves when in states H, I and K, so it can only make moves when in J, L and M, so states P, R and S are added. Blue bot cannot make a move when in states J, L and M, but only when in H, I and K, so states N, O and Q are added.

Overall, there are 19 possible states of the game their algorithm needs to analyze.

[Image]


Piegirl was asked to implement two table join operation for distributed database system, minimizing the network traffic.

Suppose she wants to join two tables, A and B. Each of them has certain number of rows which are distributed on different number of partitions. Table A is distributed on the first cluster consisting of m partitions. Partition with index i has a_{i} rows from A. Similarly, second cluster containing table B has n partitions, i-th one having b_{i} rows from B.

In one network operation she can copy one row from any partition to any other partition. At the end, for each row from A and each row from B there should be a partition that has both rows. Determine the minimal number of network operations to achieve this.

-----Input-----

First line contains two integer numbers, m and n (1 ≤ m, n ≤ 10^5). Second line contains description of the first cluster with m space separated integers, a_{i} (1 ≤ a_{i} ≤ 10^9). Similarly, third line describes second cluster with n space separated integers, b_{i} (1 ≤ b_{i} ≤ 10^9).

-----Output-----

Print one integer — minimal number of copy operations.

-----Examples-----
Input
2 2
2 6
3 100

Output
11

Input
2 3
10 10
1 1 1

Output
6

-----Note-----

In the first example it makes sense to move all the rows to the second partition of the second cluster which is achieved in 2 + 6 + 3 = 11 operations

In the second example Piegirl can copy each row from B to the both partitions of the first cluster which needs 2·3 = 6 copy operations.


Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone.

In this game, the phone's screen is divided into four vertical strips. Each second, a black square appears on some of the strips. According to the rules of the game, Jury must use this second to touch the corresponding strip to make the square go away. As Jury is both smart and lazy, he counted that he wastes exactly a_{i} calories on touching the i-th strip.

You've got a string s, describing the process of the game and numbers a_1, a_2, a_3, a_4. Calculate how many calories Jury needs to destroy all the squares?

-----Input-----

The first line contains four space-separated integers a_1, a_2, a_3, a_4 (0 ≤ a_1, a_2, a_3, a_4 ≤ 10^4).

The second line contains string s (1 ≤ |s| ≤ 10^5), where the і-th character of the string equals "1", if on the i-th second of the game the square appears on the first strip, "2", if it appears on the second strip, "3", if it appears on the third strip, "4", if it appears on the fourth strip.

-----Output-----

Print a single integer — the total number of calories that Jury wastes.

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

Output
13

Input
1 5 3 2
11221

Output
13


Nam is playing with a string on his computer. The string consists of n lowercase English letters. It is meaningless, so Nam decided to make the string more beautiful, that is to make it be a palindrome by using 4 arrow keys: left, right, up, down.

There is a cursor pointing at some symbol of the string. Suppose that cursor is at position i (1 ≤ i ≤ n, the string uses 1-based indexing) now. Left and right arrow keys are used to move cursor around the string. The string is cyclic, that means that when Nam presses left arrow key, the cursor will move to position i - 1 if i > 1 or to the end of the string (i. e. position n) otherwise. The same holds when he presses the right arrow key (if i = n, the cursor appears at the beginning of the string).

When Nam presses up arrow key, the letter which the text cursor is pointing to will change to the next letter in English alphabet (assuming that alphabet is also cyclic, i. e. after 'z' follows 'a'). The same holds when he presses the down arrow key.

Initially, the text cursor is at position p.

Because Nam has a lot homework to do, he wants to complete this as fast as possible. Can you help him by calculating the minimum number of arrow keys presses to make the string to be a palindrome?

-----Input-----

The first line contains two space-separated integers n (1 ≤ n ≤ 10^5) and p (1 ≤ p ≤ n), the length of Nam's string and the initial position of the text cursor.

The next line contains n lowercase characters of Nam's string.

-----Output-----

Print the minimum number of presses needed to change string into a palindrome.

-----Examples-----
Input
8 3
aeabcaez

Output
6

-----Note-----

A string is a palindrome if it reads the same forward or reversed.

In the sample test, initial Nam's string is: $\text{aeabcaez}$ (cursor position is shown bold).

In optimal solution, Nam may do 6 following steps:[Image]

The result, $\text{zeaccaez}$, is now a palindrome.


For a positive integer X, let f(X) be the number of positive divisors of X.
Given a positive integer N, find \sum_{K=1}^N K\times f(K).

-----Constraints-----
 - 1 \leq N \leq 10^7

-----Input-----
Input is given from Standard Input in the following format:
N

-----Output-----
Print the value \sum_{K=1}^N K\times f(K).

-----Sample Input-----
4

-----Sample Output-----
23

We have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\times 1 + 2\times 2 + 3\times 2 + 4\times 3 =23.


Takahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 100.
The shop sells N kinds of cakes.

Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i.

These values may be zero or negative.
Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows:
 - Do not have two or more pieces of the same kind of cake.
 - Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness)  + (the absolute value of the total popularity).
Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.

-----Constraints-----
 - N is an integer between 1 and 1 \ 000 (inclusive).
 - M is an integer between 0 and N (inclusive).
 - x_i, y_i, z_i \ (1 \leq i \leq N) are integers between -10 \ 000 \ 000 \ 000 and 10 \ 000 \ 000 \ 000 (inclusive).

-----Input-----
Input is given from Standard Input in the following format:
N M
x_1 y_1 z_1
x_2 y_2 z_2
 :  :
x_N y_N z_N

-----Output-----
Print the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.

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

-----Sample Output-----
56

Consider having the 2-nd, 4-th and 5-th kinds of cakes. The total beauty, tastiness and popularity will be as follows:
 - Beauty: 1 + 3 + 9 = 13
 - Tastiness: 5 + 5 + 7 = 17
 - Popularity: 9 + 8 + 9 = 26
The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 13 + 17 + 26 = 56. This is the maximum value.


Dolphin is planning to generate a small amount of a certain chemical substance C.

In order to generate the substance C, he must prepare a solution which is a mixture of two substances A and B in the ratio of M_a:M_b.

He does not have any stock of chemicals, however, so he will purchase some chemicals at a local pharmacy.

The pharmacy sells N kinds of chemicals. For each kind of chemical, there is exactly one package of that chemical in stock.

The package of chemical i contains a_i grams of the substance A and b_i grams of the substance B, and is sold for c_i yen (the currency of Japan).

Dolphin will purchase some of these packages. For some reason, he must use all contents of the purchased packages to generate the substance C.

Find the minimum amount of money required to generate the substance C.

If it is not possible to generate the substance C by purchasing any combination of packages at the pharmacy, report that fact.

-----Constraints-----
 - 1≦N≦40
 - 1≦a_i,b_i≦10
 - 1≦c_i≦100
 - 1≦M_a,M_b≦10
 - gcd(M_a,M_b)=1
 - a_i, b_i, c_i, M_a and M_b are integers.

-----Input-----
The input is given from Standard Input in the following format:
N M_a M_b
a_1 b_1 c_1
a_2 b_2 c_2
:
a_N b_N c_N

-----Output-----
Print the minimum amount of money required to generate the substance C. If it is not possible to generate the substance C, print -1 instead.

-----Sample Input-----
3 1 1
1 2 1
2 1 2
3 3 10

-----Sample Output-----
3

The amount of money spent will be minimized by purchasing the packages of chemicals 1 and 2.

In this case, the mixture of the purchased chemicals will contain 3 grams of the substance A and 3 grams of the substance B, which are in the desired ratio: 3:3=1:1.

The total price of these packages is 3 yen.


You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many Shichi-Go numbers (literally "Seven-Five numbers") are there?
Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

-----Note-----
When a positive integer A divides a positive integer B, A is said to a divisor of B.
For example, 6 has four divisors: 1, 2, 3 and 6.

-----Constraints-----
 - 1 \leq N \leq 100
 - N is an integer.

-----Input-----
Input is given from Standard Input in the following format:
N

-----Output-----
Print the number of the Shichi-Go numbers that are divisors of N!.

-----Sample Input-----
9

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

There are no Shichi-Go numbers among the divisors of 9! = 1 \times 2 \times ... \times 9 = 362880.


There are $n$ students and $m$ clubs in a college. The clubs are numbered from $1$ to $m$. Each student has a potential $p_i$ and is a member of the club with index $c_i$. Initially, each student is a member of exactly one club. A technical fest starts in the college, and it will run for the next $d$ days. There is a coding competition every day in the technical fest.

Every day, in the morning, exactly one student of the college leaves their club. Once a student leaves their club, they will never join any club again. Every day, in the afternoon, the director of the college will select one student from each club (in case some club has no members, nobody is selected from that club) to form a team for this day's coding competition. The strength of a team is the mex of potentials of the students in the team. The director wants to know the maximum possible strength of the team for each of the coming $d$ days. Thus, every day the director chooses such team, that the team strength is maximized.

The mex of the multiset $S$ is the smallest non-negative integer that is not present in $S$. For example, the mex of the $\{0, 1, 1, 2, 4, 5, 9\}$ is $3$, the mex of $\{1, 2, 3\}$ is $0$ and the mex of $\varnothing$ (empty set) is $0$.

-----Input-----

The first line contains two integers $n$ and $m$ ($1 \leq m \leq n \leq 5000$), the number of students and the number of clubs in college.

The second line contains $n$ integers $p_1, p_2, \ldots, p_n$ ($0 \leq p_i < 5000$), where $p_i$ is the potential of the $i$-th student.

The third line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \leq c_i \leq m$), which means that $i$-th student is initially a member of the club with index $c_i$.

The fourth line contains an integer $d$ ($1 \leq d \leq n$), number of days for which the director wants to know the maximum possible strength of the team.

Each of the next $d$ lines contains an integer $k_i$ ($1 \leq k_i \leq n$), which means that $k_i$-th student lefts their club on the $i$-th day. It is guaranteed, that the $k_i$-th student has not left their club earlier.

-----Output-----

For each of the $d$ days, print the maximum possible strength of the team on that day.

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

Output
3
1
1
1
0

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

Output
3
2
2
1
0

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

Output
1
1
1
1

-----Note-----

Consider the first example:

On the first day, student $3$ leaves their club. Now, the remaining students are $1$, $2$, $4$ and $5$. We can select students $1$, $2$ and $4$ to get maximum possible strength, which is $3$. Note, that we can't select students $1$, $2$ and $5$, as students $2$ and $5$ belong to the same club. Also, we can't select students $1$, $3$ and $4$, since student $3$ has left their club.

On the second day, student $2$ leaves their club. Now, the remaining students are $1$, $4$ and $5$. We can select students $1$, $4$ and $5$ to get maximum possible strength, which is $1$.

On the third day, the remaining students are $1$ and $5$. We can select students $1$ and $5$ to get maximum possible strength, which is $1$.

On the fourth day, the remaining student is $1$. We can select student $1$ to get maximum possible strength, which is $1$.

On the fifth day, no club has students and so the maximum possible strength is $0$.


Every evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm clock rings during exactly one minute and is characterized by one integer a_{i} — number of minute after midnight in which it rings. Every alarm clock begins ringing at the beginning of the minute and rings during whole minute.

Vitalya will definitely wake up if during some m consecutive minutes at least k alarm clocks will begin ringing. Pay attention that Vitalya considers only alarm clocks which begin ringing during given period of time. He doesn't consider alarm clocks which started ringing before given period of time and continues ringing during given period of time.

Vitalya is so tired that he wants to sleep all day long and not to wake up. Find out minimal number of alarm clocks Vitalya should turn off to sleep all next day. Now all alarm clocks are turned on.

-----Input-----

First line contains three integers n, m and k (1 ≤ k ≤ n ≤ 2·10^5, 1 ≤ m ≤ 10^6) — number of alarm clocks, and conditions of Vitalya's waking up.

Second line contains sequence of distinct integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^6) in which a_{i} equals minute on which i-th alarm clock will ring. Numbers are given in arbitrary order. Vitalya lives in a Berland in which day lasts for 10^6 minutes.

-----Output-----

Output minimal number of alarm clocks that Vitalya should turn off to sleep all next day long.

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

Output
1

Input
5 10 3
12 8 18 25 1

Output
0

Input
7 7 2
7 3 4 1 6 5 2

Output
6

Input
2 2 2
1 3

Output
0

-----Note-----

In first example Vitalya should turn off first alarm clock which rings at minute 3.

In second example Vitalya shouldn't turn off any alarm clock because there are no interval of 10 consequence minutes in which 3 alarm clocks will ring.

In third example Vitalya should turn off any 6 alarm clocks.


There are five people playing a game called "Generosity". Each person gives some non-zero number of coins b as an initial bet. After all players make their bets of b coins, the following operation is repeated for several times: a coin is passed from one player to some other player.

Your task is to write a program that can, given the number of coins each player has at the end of the game, determine the size b of the initial bet or find out that such outcome of the game cannot be obtained for any positive number of coins b in the initial bet.

-----Input-----

The input consists of a single line containing five integers c_1, c_2, c_3, c_4 and c_5 — the number of coins that the first, second, third, fourth and fifth players respectively have at the end of the game (0 ≤ c_1, c_2, c_3, c_4, c_5 ≤ 100).

-----Output-----

Print the only line containing a single positive integer b — the number of coins in the initial bet of each player. If there is no such value of b, then print the only value "-1" (quotes for clarity).

-----Examples-----
Input
2 5 4 0 4

Output
3

Input
4 5 9 2 1

Output
-1

-----Note-----

In the first sample the following sequence of operations is possible:  One coin is passed from the fourth player to the second player;  One coin is passed from the fourth player to the fifth player;  One coin is passed from the first player to the third player;  One coin is passed from the fourth player to the second player.


Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.

A snake is a pattern on a n by m table. Denote c-th cell of r-th row as (r, c). The tail of the snake is located at (1, 1), then it's body extends to (1, m), then goes down 2 rows to (3, m), then goes left to (3, 1) and so on.

Your task is to draw this snake for Fox Ciel: the empty cells should be represented as dot characters ('.') and the snake cells should be filled with number signs ('#').

Consider sample tests in order to understand the snake pattern.

-----Input-----

The only line contains two integers: n and m (3 ≤ n, m ≤ 50).

n is an odd number.

-----Output-----

Output n lines. Each line should contain a string consisting of m characters. Do not output spaces.

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

Output
###
..#
###

Input
3 4

Output
####
...#
####

Input
5 3

Output
###
..#
###
#..
###

Input
9 9

Output
#########
........#
#########
#........
#########
........#
#########
#........
#########


And where the are the phone numbers?

You are given a string s consisting of lowercase English letters and an integer k. Find the lexicographically smallest string t of length k, such that its set of letters is a subset of the set of letters of s and s is lexicographically smaller than t.

It's guaranteed that the answer exists.

Note that the set of letters is a set, not a multiset. For example, the set of letters of abadaba is {a, b, d}.

String p is lexicographically smaller than string q, if p is a prefix of q, is not equal to q or there exists i, such that p_{i} < q_{i} and for all j < i it is satisfied that p_{j} = q_{j}. For example, abc is lexicographically smaller than abcd , abd is lexicographically smaller than abec, afa is not lexicographically smaller than ab and a is not lexicographically smaller than a.

-----Input-----

The first line of input contains two space separated integers n and k (1 ≤ n, k ≤ 100 000) — the length of s and the required length of t.

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

-----Output-----

Output the string t conforming to the requirements above.

It's guaranteed that the answer exists.

-----Examples-----
Input
3 3
abc

Output
aca

Input
3 2
abc

Output
ac

Input
3 3
ayy

Output
yaa

Input
2 3
ba

Output
baa

-----Note-----

In the first example the list of strings t of length 3, such that the set of letters of t is a subset of letters of s is as follows: aaa, aab, aac, aba, abb, abc, aca, acb, .... Among them, those are lexicographically greater than abc: aca, acb, .... Out of those the lexicographically smallest is aca.


Vasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the system testing tab.

There are $n$ solutions, the $i$-th of them should be tested on $a_i$ tests, testing one solution on one test takes $1$ second. The solutions are judged in the order from $1$ to $n$. There are $k$ testing processes which test solutions simultaneously. Each of them can test at most one solution at a time.

At any time moment $t$ when some testing process is not judging any solution, it takes the first solution from the queue and tests it on each test in increasing order of the test ids. Let this solution have id $i$, then it is being tested on the first test from time moment $t$ till time moment $t + 1$, then on the second test till time moment $t + 2$ and so on. This solution is fully tested at time moment $t + a_i$, and after that the testing process immediately starts testing another solution.

Consider some time moment, let there be exactly $m$ fully tested solutions by this moment. There is a caption "System testing: $d$%" on the page with solutions, where $d$ is calculated as

$$d = round\left(100\cdot\frac{m}{n}\right),$$

where $round(x) = \lfloor{x + 0.5}\rfloor$ is a function which maps every real to the nearest integer.

Vasya calls a submission interesting if there is a time moment (possibly, non-integer) when the solution is being tested on some test $q$, and the caption says "System testing: $q$%". Find the number of interesting solutions.

Please note that in case when multiple processes attempt to take the first submission from the queue at the same moment (for instance, at the initial moment), the order they take the solutions does not matter.

-----Input-----

The first line contains two positive integers $n$ and $k$ ($1 \le n \le 1000$, $1 \le k \le 100$) standing for the number of submissions and the number of testing processes respectively.

The second line contains $n$ positive integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 150$), where $a_i$ is equal to the number of tests the $i$-th submission is to be run on.

-----Output-----

Output the only integer — the number of interesting submissions.

-----Examples-----
Input
2 2
49 100

Output
1

Input
4 2
32 100 33 1

Output
2

Input
14 5
48 19 6 9 50 20 3 42 38 43 36 21 44 6

Output
5

-----Note-----

Consider the first example. At time moment $0$ both solutions start testing. At time moment $49$ the first solution is fully tested, so at time moment $49.5$ the second solution is being tested on the test $50$, and the caption says "System testing: $50$%" (because there is one fully tested solution out of two). So, the second solution is interesting.

Consider the second example. At time moment $0$ the first and the second solutions start testing. At time moment $32$ the first solution is fully tested, the third solution starts testing, the caption says "System testing: $25$%". At time moment $32 + 24.5 = 56.5$ the third solutions is being tested on test $25$, the caption is still the same, thus this solution is interesting. After that the third solution is fully tested at time moment $32 + 33 = 65$, the fourth solution is fully tested at time moment $65 + 1 = 66$. The captions becomes "System testing: $75$%", and at time moment $74.5$ the second solution is being tested on test $75$. So, this solution is also interesting. Overall, there are two interesting solutions.


There are famous Russian nesting dolls named matryoshkas sold in one of the souvenir stores nearby, and you'd like to buy several of them. The store has $n$ different matryoshkas. Any matryoshka is a figure of volume $out_i$ with an empty space inside of volume $in_i$ (of course, $out_i > in_i$).

You don't have much free space inside your bag, but, fortunately, you know that matryoshkas can be nested one inside another. Formally, let's call a set of matryoshkas nested if we can rearrange dolls in such a way, that the first doll can be nested inside the second one, the second doll — inside the third one and so on. Matryoshka $i$ can be nested inside matryoshka $j$ if $out_i \le in_j$. So only the last doll will take space inside your bag.

Let's call extra space of a nested set of dolls as a total volume of empty space inside this structure. Obviously, it's equal to $in_{i_1} + (in_{i_2} - out_{i_1}) + (in_{i_3} - out_{i_2}) + \dots + (in_{i_k} - out_{i_{k-1}})$, where $i_1$, $i_2$, ..., $i_k$ are the indices of the chosen dolls in the order they are nested in each other.

Finally, let's call a nested subset of the given sequence as big enough if there isn't any doll from the sequence that can be added to the nested subset without breaking its nested property.

You want to buy many matryoshkas, so you should choose a big enough nested subset to buy it. But you will be disappointed if too much space in your bag will be wasted, so you want to choose a big enough subset so that its extra space is minimum possible among all big enough subsets. Now you wonder, how many different nested subsets meet these conditions (they are big enough, and there is no big enough subset such that its extra space is less than the extra space of the chosen subset). Two subsets are considered different if there exists at least one index $i$ such that one of the subsets contains the $i$-th doll, and another subset doesn't.

Since the answer can be large, print it modulo $10^9 + 7$.

-----Input-----

The first line contains a single integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the number of matryoshkas.

The next $n$ lines contain a description of each doll: two integers $out_i$ and $in_i$ ($1 \le in_i < out_i \le 10^9$) — the outer and inners volumes of the $i$-th matryoshka.

-----Output-----

Print one integer — the number of big enough nested subsets such that extra space of each of these subsets is minimum possible. Since the answer can be large, print it modulo $10^9 + 7$.

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

Output
6

-----Note-----

There are $6$ big enough nested subsets with minimum possible extra space in the example:   $\{1, 5\}$: we can't add any other matryoshka and keep it nested; it's extra space is $1$;  $\{1, 6\}$;  $\{2, 4, 5\}$;  $\{2, 4, 6\}$;  $\{3, 4, 5\}$;  $\{3, 4, 6\}$.

There are no more "good" subsets because, for example, subset $\{6, 7\}$ is not big enough (we can add the $4$-th matryoshka to it) or subset $\{4, 6, 7\}$ has extra space equal to $2$.


Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For convenience, we enumerate all languages of the world with integers from 1 to 10^9.

In the evening after the conference, all n scientists decided to go to the cinema. There are m movies in the cinema they came to. Each of the movies is characterized by two distinct numbers — the index of audio language and the index of subtitles language. The scientist, who came to the movie, will be very pleased if he knows the audio language of the movie, will be almost satisfied if he knows the language of subtitles and will be not satisfied if he does not know neither one nor the other (note that the audio language and the subtitles language for each movie are always different).

Scientists decided to go together to the same movie. You have to help them choose the movie, such that the number of very pleased scientists is maximum possible. If there are several such movies, select among them one that will maximize the number of almost satisfied scientists.

-----Input-----

The first line of the input contains a positive integer n (1 ≤ n ≤ 200 000) — the number of scientists.

The second line contains n positive integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^9), where a_{i} is the index of a language, which the i-th scientist knows.

The third line contains a positive integer m (1 ≤ m ≤ 200 000) — the number of movies in the cinema.

The fourth line contains m positive integers b_1, b_2, ..., b_{m} (1 ≤ b_{j} ≤ 10^9), where b_{j} is the index of the audio language of the j-th movie.

The fifth line contains m positive integers c_1, c_2, ..., c_{m} (1 ≤ c_{j} ≤ 10^9), where c_{j} is the index of subtitles language of the j-th movie.

It is guaranteed that audio languages and subtitles language are different for each movie, that is b_{j} ≠ c_{j}.

-----Output-----

Print the single integer — the index of a movie to which scientists should go. After viewing this movie the number of very pleased scientists should be maximum possible. If in the cinema there are several such movies, you need to choose among them one, after viewing which there will be the maximum possible number of almost satisfied scientists.

If there are several possible answers print any of them.

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

Output
2

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

Output
1

-----Note-----

In the first sample, scientists must go to the movie with the index 2, as in such case the 1-th and the 3-rd scientists will be very pleased and the 2-nd scientist will be almost satisfied.

In the second test case scientists can go either to the movie with the index 1 or the index 3. After viewing any of these movies exactly two scientists will be very pleased and all the others will be not satisfied.


You are given a permutation p of numbers 1, 2, ..., n. Let's define f(p) as the following sum:$f(p) = \sum_{i = 1}^{n} \sum_{j = i}^{n} \operatorname{min}(p_{i}, p_{i + 1}, \ldots p_{j})$

Find the lexicographically m-th permutation of length n in the set of permutations having the maximum possible value of f(p).

-----Input-----

The single line of input contains two integers n and m (1 ≤ m ≤ cnt_{n}), where cnt_{n} is the number of permutations of length n with maximum possible value of f(p).

The problem consists of two subproblems. The subproblems have different constraints on the input. You will get some score for the correct submission of the subproblem. The description of the subproblems follows.  In subproblem B1 (3 points), the constraint 1 ≤ n ≤ 8 will hold.  In subproblem B2 (4 points), the constraint 1 ≤ n ≤ 50 will hold.

-----Output-----

Output n number forming the required permutation.

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

Output
2 1

Input
3 2

Output
1 3 2

-----Note-----

In the first example, both permutations of numbers {1, 2} yield maximum possible f(p) which is equal to 4. Among them, (2, 1) comes second in lexicographical order.


A coordinate line has n segments, the i-th segment starts at the position l_{i} and ends at the position r_{i}. We will denote such a segment as [l_{i}, r_{i}].

You have suggested that one of the defined segments covers all others. In other words, there is such segment in the given set, which contains all other ones. Now you want to test your assumption. Find in the given set the segment which covers all other segments, and print its number. If such a segment doesn't exist, print -1.

Formally we will assume that segment [a, b] covers segment [c, d], if they meet this condition a ≤ c ≤ d ≤ b.

-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5) — the number of segments. Next n lines contain the descriptions of the segments. The i-th line contains two space-separated integers l_{i}, r_{i} (1 ≤ l_{i} ≤ r_{i} ≤ 10^9) — the borders of the i-th segment.

It is guaranteed that no two segments coincide.

-----Output-----

Print a single integer — the number of the segment that covers all other segments in the set. If there's no solution, print -1.

The segments are numbered starting from 1 in the order in which they appear in the input.

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

Output
-1

Input
6
1 5
2 3
1 10
7 10
7 7
10 10

Output
3


Monocarp has arranged $n$ colored marbles in a row. The color of the $i$-th marble is $a_i$. Monocarp likes ordered things, so he wants to rearrange marbles in such a way that all marbles of the same color form a contiguos segment (and there is only one such segment for each color).

In other words, Monocarp wants to rearrange marbles so that, for every color $j$, if the leftmost marble of color $j$ is $l$-th in the row, and the rightmost marble of this color has position $r$ in the row, then every marble from $l$ to $r$ has color $j$.

To achieve his goal, Monocarp can do the following operation any number of times: choose two neighbouring marbles, and swap them.

You have to calculate the minimum number of operations Monocarp has to perform to rearrange the marbles. Note that the order of segments of marbles having equal color does not matter, it is only required that, for every color, all the marbles of this color form exactly one contiguous segment.

-----Input-----

The first line contains one integer $n$ $(2 \le n \le 4 \cdot 10^5)$ — the number of marbles.

The second line contains an integer sequence $a_1, a_2, \dots, a_n$ $(1 \le a_i \le 20)$, where $a_i$ is the color of the $i$-th marble.

-----Output-----

Print the minimum number of operations Monocarp has to perform to achieve his goal.

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

Output
3

Input
5
20 1 14 10 2

Output
0

Input
13
5 5 4 4 3 5 7 6 5 4 4 6 5

Output
21

-----Note-----

In the first example three operations are enough. Firstly, Monocarp should swap the third and the fourth marbles, so the sequence of colors is $[3, 4, 3, 2, 4, 2, 2]$. Then Monocarp should swap the second and the third marbles, so the sequence is $[3, 3, 4, 2, 4, 2, 2]$. And finally, Monocarp should swap the fourth and the fifth marbles, so the sequence is $[3, 3, 4, 4, 2, 2, 2]$.

In the second example there's no need to perform any operations.


There is a sequence of colorful stones. The color of each stone is one of red, green, or blue. You are given a string s. The i-th (1-based) character of s represents the color of the i-th stone. If the character is "R", "G", or "B", the color of the corresponding stone is red, green, or blue, respectively.

Initially Squirrel Liss is standing on the first stone. You perform instructions one or more times.

Each instruction is one of the three types: "RED", "GREEN", or "BLUE". After an instruction c, if Liss is standing on a stone whose colors is c, Liss will move one stone forward, else she will not move.

You are given a string t. The number of instructions is equal to the length of t, and the i-th character of t represents the i-th instruction.

Calculate the final position of Liss (the number of the stone she is going to stand on in the end) after performing all the instructions, and print its 1-based position. It is guaranteed that Liss don't move out of the sequence.

-----Input-----

The input contains two lines. The first line contains the string s (1 ≤ |s| ≤ 50). The second line contains the string t (1 ≤ |t| ≤ 50). The characters of each string will be one of "R", "G", or "B". It is guaranteed that Liss don't move out of the sequence.

-----Output-----

Print the final 1-based position of Liss in a single line.

-----Examples-----
Input
RGB
RRR

Output
2

Input
RRRBGBRBBB
BBBRR

Output
3

Input
BRRBGBRGRBGRGRRGGBGBGBRGBRGRGGGRBRRRBRBBBGRRRGGBBB
BBRBGGRGRGBBBRBGRBRBBBBRBRRRBGBBGBBRRBBGGRBRRBRGRB

Output
15


There are n boxes with colored balls on the table. Colors are numbered from 1 to n. i-th box contains a_{i} balls, all of which have color i. You have to write a program that will divide all balls into sets such that:  each ball belongs to exactly one of the sets,  there are no empty sets,  there is no set containing two (or more) balls of different colors (each set contains only balls of one color),  there are no two sets such that the difference between their sizes is greater than 1.

Print the minimum possible number of sets.

-----Input-----

The first line contains one integer number n (1 ≤ n ≤ 500).

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

-----Output-----

Print one integer number — the minimum possible number of sets.

-----Examples-----
Input
3
4 7 8

Output
5

Input
2
2 7

Output
4

-----Note-----

In the first example the balls can be divided into sets like that: one set with 4 balls of the first color, two sets with 3 and 4 balls, respectively, of the second color, and two sets with 4 balls of the third color.


Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities.

To bake muffins in her bakery, Masha needs to establish flour supply from some storage. There are only k storages, located in different cities numbered a_1, a_2, ..., a_{k}.

Unforunately the law of the country Masha lives in prohibits opening bakery in any of the cities which has storage located in it. She can open it only in one of another n - k cities, and, of course, flour delivery should be paid — for every kilometer of path between storage and bakery Masha should pay 1 ruble.

Formally, Masha will pay x roubles, if she will open the bakery in some city b (a_{i} ≠ b for every 1 ≤ i ≤ k) and choose a storage in some city s (s = a_{j} for some 1 ≤ j ≤ k) and b and s are connected by some path of roads of summary length x (if there are more than one path, Masha is able to choose which of them should be used).

Masha is very thrifty and rational. She is interested in a city, where she can open her bakery (and choose one of k storages and one of the paths between city with bakery and city with storage) and pay minimum possible amount of rubles for flour delivery. Please help Masha find this amount.

-----Input-----

The first line of the input contains three integers n, m and k (1 ≤ n, m ≤ 10^5, 0 ≤ k ≤ n) — the number of cities in country Masha lives in, the number of roads between them and the number of flour storages respectively.

Then m lines follow. Each of them contains three integers u, v and l (1 ≤ u, v ≤ n, 1 ≤ l ≤ 10^9, u ≠ v) meaning that there is a road between cities u and v of length of l kilometers .

If k > 0, then the last line of the input contains k distinct integers a_1, a_2, ..., a_{k} (1 ≤ a_{i} ≤ n) — the number of cities having flour storage located in. If k = 0 then this line is not presented in the input.

-----Output-----

Print the minimum possible amount of rubles Masha should pay for flour delivery in the only line.

If the bakery can not be opened (while satisfying conditions) in any of the n cities, print  - 1 in the only line.

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

Output
3
Input
3 1 1
1 2 3
3

Output
-1

-----Note-----

[Image]

Image illustrates the first sample case. Cities with storage located in and the road representing the answer are darkened.


You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the given array.

A subarray is the sequence of consecutive elements of the array. Subarray is called increasing if each element of this subarray strictly greater than previous.

-----Input-----

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

The second line contains n positive integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^9).

-----Output-----

Print the maximum length of an increasing subarray of the given array.

-----Examples-----
Input
5
1 7 2 11 15

Output
3

Input
6
100 100 100 100 100 100

Output
1

Input
3
1 2 3

Output
3


Vasya has found a piece of paper with an array written on it. The array consists of n integers a_1, a_2, ..., a_{n}. Vasya noticed that the following condition holds for the array a_{i} ≤ a_{i} + 1 ≤ 2·a_{i} for any positive integer i (i < n).

Vasya wants to add either a "+" or a "-" before each number of array. Thus, Vasya will get an expression consisting of n summands. The value of the resulting expression is the sum of all its elements. The task is to add signs "+" and "-" before each number so that the value of expression s meets the limits 0 ≤ s ≤ a_1. Print a sequence of signs "+" and "-", satisfying the given limits. It is guaranteed that the solution for the problem exists.

-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^5) — the size of the array. The second line contains space-separated integers a_1, a_2, ..., a_{n} (0 ≤ a_{i} ≤ 10^9) — the original array.

It is guaranteed that the condition a_{i} ≤ a_{i} + 1 ≤ 2·a_{i} fulfills for any positive integer i (i < n).

-----Output-----

In a single line print the sequence of n characters "+" and "-", where the i-th character is the sign that is placed in front of number a_{i}. The value of the resulting expression s must fit into the limits 0 ≤ s ≤ a_1. If there are multiple solutions, you are allowed to print any of them.

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

Output
+++-
Input
3
3 3 5

Output
++-


It is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a special problem for the students to solve. You being his favourite student, put your heart into solving it one last time.

You are given two polynomials $f(x) = a_0 + a_1x + \dots + a_{n-1}x^{n-1}$ and $g(x) = b_0 + b_1x + \dots + b_{m-1}x^{m-1}$, with positive integral coefficients. It is guaranteed that the cumulative GCD of the coefficients is equal to $1$ for both the given polynomials. In other words, $gcd(a_0, a_1, \dots, a_{n-1}) = gcd(b_0, b_1, \dots, b_{m-1}) = 1$. Let $h(x) = f(x)\cdot g(x)$. Suppose that $h(x) = c_0 + c_1x + \dots + c_{n+m-2}x^{n+m-2}$.

You are also given a prime number $p$. Professor R challenges you to find any $t$ such that $c_t$ isn't divisible by $p$. He guarantees you that under these conditions such $t$ always exists. If there are several such $t$, output any of them.

As the input is quite large, please use fast input reading methods.

-----Input-----

The first line of the input contains three integers, $n$, $m$ and $p$ ($1 \leq n, m \leq 10^6, 2 \leq p \leq 10^9$),  — $n$ and $m$ are the number of terms in $f(x)$ and $g(x)$ respectively (one more than the degrees of the respective polynomials) and $p$ is the given prime number.

It is guaranteed that $p$ is prime.

The second line contains $n$ integers $a_0, a_1, \dots, a_{n-1}$ ($1 \leq a_{i} \leq 10^{9}$) — $a_i$ is the coefficient of $x^{i}$ in $f(x)$.

The third line contains $m$ integers $b_0, b_1, \dots, b_{m-1}$ ($1 \leq b_{i} \leq 10^{9}$)  — $b_i$ is the coefficient of $x^{i}$ in $g(x)$.

-----Output-----

Print a single integer $t$ ($0\le t \le n+m-2$)  — the appropriate power of $x$ in $h(x)$ whose coefficient isn't divisible by the given prime $p$. If there are multiple powers of $x$ that satisfy the condition, print any.

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

Output
1

Input
2 2 999999937
2 1
3 1

Output
2

-----Note-----

In the first test case, $f(x)$ is $2x^2 + x + 1$ and $g(x)$ is $x + 2$, their product $h(x)$ being $2x^3 + 5x^2 + 3x + 2$, so the answer can be 1 or 2 as both 3 and 5 aren't divisible by 2.

In the second test case, $f(x)$ is $x + 2$ and $g(x)$ is $x + 3$, their product $h(x)$ being $x^2 + 5x + 6$, so the answer can be any of the powers as no coefficient is divisible by the given prime.


After you had helped Fedor to find friends in the «Call of Soldiers 3» game, he stopped studying completely. Today, the English teacher told him to prepare an essay. Fedor didn't want to prepare the essay, so he asked Alex for help. Alex came to help and wrote the essay for Fedor. But Fedor didn't like the essay at all. Now Fedor is going to change the essay using the synonym dictionary of the English language.

Fedor does not want to change the meaning of the essay. So the only change he would do: change a word from essay to one of its synonyms, basing on a replacement rule from the dictionary. Fedor may perform this operation any number of times.

As a result, Fedor wants to get an essay which contains as little letters «R» (the case doesn't matter) as possible. If there are multiple essays with minimum number of «R»s he wants to get the one with minimum length (length of essay is the sum of the lengths of all the words in it). Help Fedor get the required essay.

Please note that in this problem the case of letters doesn't matter. For example, if the synonym dictionary says that word cat can be replaced with word DOG, then it is allowed to replace the word Cat with the word doG.

-----Input-----

The first line contains a single integer m (1 ≤ m ≤ 10^5) — the number of words in the initial essay. The second line contains words of the essay. The words are separated by a single space. It is guaranteed that the total length of the words won't exceed 10^5 characters.

The next line contains a single integer n (0 ≤ n ≤ 10^5) — the number of pairs of words in synonym dictionary. The i-th of the next n lines contains two space-separated non-empty words x_{i} and y_{i}. They mean that word x_{i} can be replaced with word y_{i} (but not vise versa). It is guaranteed that the total length of all pairs of synonyms doesn't exceed 5·10^5 characters.

All the words at input can only consist of uppercase and lowercase letters of the English alphabet.

-----Output-----

Print two integers — the minimum number of letters «R» in an optimal essay and the minimum length of an optimal essay.

-----Examples-----
Input
3
AbRb r Zz
4
xR abRb
aA xr
zz Z
xr y

Output
2 6

Input
2
RuruRu fedya
1
ruruRU fedor

Output
1 10


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

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

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

-----Input-----

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

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

-----Output-----

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

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

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

Output
3
1 2
1 3
3 2

Input
4 2
2 0 1 3

Output
3
1 3
1 4
2 3

Input
3 1
0 0 0

Output
-1


It is winter now, and Max decided it's about time he watered the garden.

The garden can be represented as n consecutive garden beds, numbered from 1 to n. k beds contain water taps (i-th tap is located in the bed x_{i}), which, if turned on, start delivering water to neighbouring beds. If the tap on the bed x_{i} is turned on, then after one second has passed, the bed x_{i} will be watered; after two seconds have passed, the beds from the segment [x_{i} - 1, x_{i} + 1] will be watered (if they exist); after j seconds have passed (j is an integer number), the beds from the segment [x_{i} - (j - 1), x_{i} + (j - 1)] will be watered (if they exist). Nothing changes during the seconds, so, for example, we can't say that the segment [x_{i} - 2.5, x_{i} + 2.5] will be watered after 2.5 seconds have passed; only the segment [x_{i} - 2, x_{i} + 2] will be watered at that moment.

 $\left. \begin{array}{|c|c|c|c|c|} \hline 1 & {2} & {3} & {4} & {5} \\ \hline \end{array} \right.$ The garden from test 1. White colour denotes a garden bed without a tap, red colour — a garden bed with a tap.

 $\left. \begin{array}{|c|c|c|c|c|} \hline 1 & {2} & {3} & {4} & {5} \\ \hline \end{array} \right.$ The garden from test 1 after 2 seconds have passed after turning on the tap. White colour denotes an unwatered garden bed, blue colour — a watered bed.

Max wants to turn on all the water taps at the same moment, and now he wonders, what is the minimum number of seconds that have to pass after he turns on some taps until the whole garden is watered. Help him to find the answer!

-----Input-----

The first line contains one integer t — the number of test cases to solve (1 ≤ t ≤ 200).

Then t test cases follow. The first line of each test case contains two integers n and k (1 ≤ n ≤ 200, 1 ≤ k ≤ n) — the number of garden beds and water taps, respectively.

Next line contains k integers x_{i} (1 ≤ x_{i} ≤ n) — the location of i-th water tap. It is guaranteed that for each $i \in [ 2 ; k ]$ condition x_{i} - 1 < x_{i} holds.

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

Note that in hacks you have to set t = 1.

-----Output-----

For each test case print one integer — the minimum number of seconds that have to pass after Max turns on some of the water taps, until the whole garden is watered.

-----Example-----
Input
3
5 1
3
3 3
1 2 3
4 1
1

Output
3
1
4

-----Note-----

The first example consists of 3 tests:

  There are 5 garden beds, and a water tap in the bed 3. If we turn it on, then after 1 second passes, only bed 3 will be watered; after 2 seconds pass, beds [1, 3] will be watered, and after 3 seconds pass, everything will be watered.  There are 3 garden beds, and there is a water tap in each one. If we turn all of them on, then everything will be watered after 1 second passes.  There are 4 garden beds, and only one tap in the bed 1. It will take 4 seconds to water, for example, bed 4.


You are given a string $s$ of length $n$, which consists only of the first $k$ letters of the Latin alphabet. All letters in string $s$ are uppercase.

A subsequence of string $s$ is a string that can be derived from $s$ by deleting some of its symbols without changing the order of the remaining symbols. For example, "ADE" and "BD" are subsequences of "ABCDE", but "DEA" is not.

A subsequence of $s$ called good if the number of occurences of each of the first $k$ letters of the alphabet is the same.

Find the length of the longest good subsequence of $s$.

-----Input-----

The first line of the input contains integers $n$ ($1\le n \le 10^5$) and $k$ ($1 \le k \le 26$).

The second line of the input contains the string $s$ of length $n$. String $s$ only contains uppercase letters from 'A' to the $k$-th letter of Latin alphabet.

-----Output-----

Print the only integer — the length of the longest good subsequence of string $s$.

-----Examples-----
Input
9 3
ACAABCCAB

Output
6
Input
9 4
ABCABCABC

Output
0

-----Note-----

In the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.

In the second example, none of the subsequences can have 'D', hence the answer is $0$.


You have two integers $l$ and $r$. Find an integer $x$ which satisfies the conditions below:

  $l \le x \le r$.  All digits of $x$ are different.

If there are multiple answers, print any of them.

-----Input-----

The first line contains two integers $l$ and $r$ ($1 \le l \le r \le 10^{5}$).

-----Output-----

If an answer exists, print any of them. Otherwise, print $-1$.

-----Examples-----
Input
121 130

Output
123

Input
98766 100000

Output
-1

-----Note-----

In the first example, $123$ is one of the possible answers. However, $121$ can't be the answer, because there are multiple $1$s on different digits.

In the second example, there is no valid answer.


You are given an array consisting of $n$ integers $a_1, a_2, \dots , a_n$ and an integer $x$. It is guaranteed that for every $i$, $1 \le a_i \le x$.

Let's denote a function $f(l, r)$ which erases all values such that $l \le a_i \le r$ from the array $a$ and returns the resulting array. For example, if $a = [4, 1, 1, 4, 5, 2, 4, 3]$, then $f(2, 4) = [1, 1, 5]$.

Your task is to calculate the number of pairs $(l, r)$ such that $1 \le l \le r \le x$ and $f(l, r)$ is sorted in non-descending order. Note that the empty array is also considered sorted.

-----Input-----

The first line contains two integers $n$ and $x$ ($1 \le n, x \le 10^6$) — the length of array $a$ and the upper limit for its elements, respectively.

The second line contains $n$ integers $a_1, a_2, \dots a_n$ ($1 \le a_i \le x$).

-----Output-----

Print the number of pairs $1 \le l \le r \le x$ such that $f(l, r)$ is sorted in non-descending order.

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

Output
4

Input
7 4
1 3 1 2 2 4 3

Output
6

-----Note-----

In the first test case correct pairs are $(1, 1)$, $(1, 2)$, $(1, 3)$ and $(2, 3)$.

In the second test case correct pairs are $(1, 3)$, $(1, 4)$, $(2, 3)$, $(2, 4)$, $(3, 3)$ and $(3, 4)$.


Ann has recently started commuting by subway. We know that a one ride subway ticket costs a rubles. Besides, Ann found out that she can buy a special ticket for m rides (she can buy it several times). It costs b rubles. Ann did the math; she will need to use subway n times. Help Ann, tell her what is the minimum sum of money she will have to spend to make n rides?

-----Input-----

The single line contains four space-separated integers n, m, a, b (1 ≤ n, m, a, b ≤ 1000) — the number of rides Ann has planned, the number of rides covered by the m ride ticket, the price of a one ride ticket and the price of an m ride ticket.

-----Output-----

Print a single integer — the minimum sum in rubles that Ann will need to spend.

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

Output
6

Input
5 2 2 3

Output
8

-----Note-----

In the first sample one of the optimal solutions is: each time buy a one ride ticket. There are other optimal solutions. For example, buy three m ride tickets.


Alice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consisting of n square cells (that is, on a 1 × n table).

At the beginning of the game Alice puts k ships on the field without telling their positions to Bob. Each ship looks as a 1 × a rectangle (that is, it occupies a sequence of a consecutive squares of the field). The ships cannot intersect and even touch each other.

After that Bob makes a sequence of "shots". He names cells of the field and Alice either says that the cell is empty ("miss"), or that the cell belongs to some ship ("hit").

But here's the problem! Alice like to cheat. May be that is why she responds to each Bob's move with a "miss".

Help Bob catch Alice cheating — find Bob's first move, such that after it you can be sure that Alice cheated.

-----Input-----

The first line of the input contains three integers: n, k and a (1 ≤ n, k, a ≤ 2·10^5) — the size of the field, the number of the ships and the size of each ship. It is guaranteed that the n, k and a are such that you can put k ships of size a on the field, so that no two ships intersect or touch each other.

The second line contains integer m (1 ≤ m ≤ n) — the number of Bob's moves.

The third line contains m distinct integers x_1, x_2, ..., x_{m}, where x_{i} is the number of the cell where Bob made the i-th shot. The cells are numbered from left to right from 1 to n.

-----Output-----

Print a single integer — the number of such Bob's first move, after which you can be sure that Alice lied. Bob's moves are numbered from 1 to m in the order the were made. If the sought move doesn't exist, then print "-1".

-----Examples-----
Input
11 3 3
5
4 8 6 1 11

Output
3

Input
5 1 3
2
1 5

Output
-1

Input
5 1 3
1
3

Output
1


Given simple (without self-intersections) n-gon. It is not necessary convex. Also you are given m lines. For each line find the length of common part of the line and the n-gon.

The boundary of n-gon belongs to polygon. It is possible that n-gon contains 180-degree angles.

-----Input-----

The first line contains integers n and m (3 ≤ n ≤ 1000;1 ≤ m ≤ 100). The following n lines contain coordinates of polygon vertices (in clockwise or counterclockwise direction). All vertices are distinct.

The following m lines contain line descriptions. Each of them contains two distict points of a line by their coordinates.

All given in the input coordinates are real numbers, given with at most two digits after decimal point. They do not exceed 10^5 by absolute values.

-----Output-----

Print m lines, the i-th line should contain the length of common part of the given n-gon and the i-th line. The answer will be considered correct if the absolute or relative error doesn't exceed 10^{ - 6}.

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

Output
1.41421356237309514547
1.00000000000000000000
0.00000000000000000000