You are given a ternary string (it is a string which consists only of characters '0', '1' and '2').
You can swap any two adjacent (consecutive) characters '0' and '1' (i.e. replace "01" with "10" or vice versa) or any two adjacent (consecutive) characters '1' and '2' (i.e. replace "12" with "21" or vice versa).
For example, for string "010210" we can perform the following moves:
Note than you cannot swap "02" →→ "20" and vice versa. You cannot perform any other operations with the given string excluding described above.
You task is to obtain the minimum possible (lexicographically) string by using these swaps arbitrary number of times (possibly, zero).
String aa is lexicographically less than string bb (if strings aa and bb have the same length) if there exists some position ii (1≤i≤|a|1≤i≤|a|, where |s||s| is the length of the string ss) such that for every j Input The first line of the input contains the string ss consisting only of characters '0', '1' and '2', its length is between 11 and 105105 (inclusive). Output Print a single string — the minimum possible (lexicographically) string you can obtain by using the swaps described above arbitrary number of times (possibly, zero). Examples input Copy output Copy input Copy output Copy input Copy output Copy Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the planet. Natasha is the inhabitant of Earth, therefore she had to pay the tax to enter the territory of Mars. There are nn banknote denominations on Mars: the value of ii-th banknote is aiai. Natasha has an infinite number of banknotes of each denomination. Martians have kk fingers on their hands, so they use a number system with base kk. In addition, the Martians consider the digit dd (in the number system with base kk) divine. Thus, if the last digit in Natasha's tax amount written in the number system with the base kk is dd, the Martians will be happy. Unfortunately, Natasha does not know the Martians' divine digit yet. Determine for which values dd Natasha can make the Martians happy. Natasha can use only her banknotes. Martians don't give her change. Input The first line contains two integers nn and kk (1≤n≤1000001≤n≤100000, 2≤k≤1000002≤k≤100000) — the number of denominations of banknotes and the base of the number system on Mars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤1091≤ai≤109) — denominations of banknotes on Mars. All numbers are given in decimal notation. Output On the first line output the number of values dd for which Natasha can make the Martians happy. In the second line, output all these values in increasing order. Print all numbers in decimal notation. Examples input Copy output Copy input Copy output Copy Note Consider the first test case. It uses the octal number system. If you take one banknote with the value of 1212, you will get 148148 in octal system. The last digit is 4848. If you take one banknote with the value of 1212 and one banknote with the value of 2020, the total value will be 3232. In the octal system, it is 408408. The last digit is 0808. If you take two banknotes with the value of 2020, the total value will be 4040, this is 508508 in the octal system. The last digit is 0808. No other digits other than 0808 and 4848 can be obtained. Digits 0808 and 4848 could also be obtained in other ways. The second test case uses the decimal number system. The nominals of all banknotes end with zero, so Natasha can give the Martians only the amount whose decimal notation also ends with zero. Alice got an array of length nn as a birthday present once again! This is the third year in a row! And what is more disappointing, it is overwhelmengly boring, filled entirely with zeros. Bob decided to apply some changes to the array to cheer up Alice. Bob has chosen mm changes of the following form. For some integer numbers xx and dd, he chooses an arbitrary position ii (1≤i≤n1≤i≤n) and for every j∈[1,n]j∈[1,n] adds x+d⋅dist(i,j)x+d⋅dist(i,j) to the value of the jj-th cell. dist(i,j)dist(i,j) is the distance between positions ii and jj (i.e. dist(i,j)=|i−j|dist(i,j)=|i−j|, where |x||x| is an absolute value of xx). For example, if Alice currently has an array [2,1,2,2][2,1,2,2] and Bob chooses position 33 for x=−1x=−1 and d=2d=2 then the array will become [2−1+2⋅2, 1−1+2⋅1, 2−1+2⋅0, 2−1+2⋅1][2−1+2⋅2, 1−1+2⋅1, 2−1+2⋅0, 2−1+2⋅1] = [5,2,1,3][5,2,1,3]. Note that Bob can't choose position ii outside of the array (that is, smaller than 11 or greater than nn). Alice will be the happiest when the elements of the array are as big as possible. Bob claimed that the arithmetic mean value of the elements will work fine as a metric. What is the maximum arithmetic mean value Bob can achieve? Input The first line contains two integers nn and mm (1≤n,m≤1051≤n,m≤105) — the number of elements of the array and the number of changes. Each of the next mm lines contains two integers xixi and didi (−103≤xi,di≤103−103≤xi,di≤103) — the parameters for the ii-th change. Output Print the maximal average arithmetic mean of the elements Bob can achieve. Your answer is considered correct if its absolute or relative error doesn't exceed 10−610−6. Examples input Copy output Copy input Copy output Copy 100210
001120
11222121
11112222
20
20
#include
2 8
12 20
2
0 4
3 10
10 20 30
1
0
#include
2 3
-1 3
0 0
-1 -4
-2.500000000000000
3 2
0 2
5 0
7.000000000000000
#include