Friedchicken likes playing Majsoul and has strong luck. So it is easy for him to get Yakuman which is a difficult thing in Majsoul. He wants more friends to play Majsoul with him,so he try to teach you.
First, you need to know the Tile's types. 
For example 1m means Ii man, 1z means Ton.
There some special tiles hands called Yakuman, such as: 
Now, Friedchicken wants to test your Majsoul's level.He will given you some Yakuman's name, you should print out the tiles from left to right according to the image above.
A string represents Yakuman's name.
Output one line represent the tiles, each tile is separated by a space
Blessing of Heaven
1m 2m 3m 4p 4p 4p 5s 6s 7s 1z 1z 1z 2z 2z
Blessing of Earth
1m 2m 3m 4p 4p 4p 5s 6s 7s 1z 1z 1z 2z 2z
As we all know, ZYW is a master of roll. Now, at the end of this term, everyone wants to know how many points ZYW has scored. But ZYW believes that only people who are intelligent enough can know his score. So he told you his encrypted score.
There are only two courses in this semester. Let's assume that ZYW's scores are $$$a$$$ and $$$b$$$, respectively. He will tell you $$$a+b$$$ and $$$a\ \And \ b$$$. Can you tell the value of $$$a\oplus b$$$?
"$$$\And$$$" and "$$$\oplus$$$" represents bitwise AND and XOR operation, respectively.
The input consists of two integers $$$a+b$$$ and $$$a\ \And\ b\ (0\le a,b \le 10^9)$$$.
Output an integer representing $$$a\oplus b$$$.
5 2
1
Given an array, it's easy to calculate its maximum value $$$A$$$ and minimum value $$$B$$$. We then define variation range $$$V$$$ of an array as $$$V = A - B$$$. Now zyw has an integer array $$$a_1, a_2, ... , a_n$$$ and an array brush with length $$$k$$$. The array brush can convert exact $$$k$$$ consecutive numbers in the array into their average. Zyw only has one chance to use the array brush and he wants to minimize the variation range of the array. Can you tell him the minimum variation range?
There are two lines in the input.
The first line contains two integers $$$n, k\ (1 \leq n \leq 10^5, 1 \leq k \leq n)$$$, represents the length of the array and the array brush.
The second line contains $$$n$$$ integers $$$a_1, a_2, ... , a_n\ (-10^5 \leq a_i \leq 10^5)$$$, represents the original array.
Output one real number $$$V$$$, represents the minimum variation range zyw can get. Your answer should have an absolute or relative error of at most $$$10^{-4}$$$.
5 3 2 3 1 4 5
1.333333
5 2 2 3 1 4 5
3.000000
In the first sample, zyw performs array brush on $$$[1, 4, 5]$$$ and the array becomes $$$[2, 3, 3.3333, 3.3333, 3.3333]$$$, the variation range is $$$1.3333$$$.
As a total bookworm, doing a lot of reading every day is an integral part of Waff's life. After reading all the books several times over, Waff found the old way of reading too boring.
Now, Waff plans to pick a book from his shelf first, and when he finishes it, the title of the next book must be the result of adding an arbitrary letter in any one place(at the beginning, between two letters, or at the end) to the title of this book. Waff then repeats this process until there are no more books to read that satisfy the condition. For example, if the book Waff is reading is called tom, the title of the next book that satisfies the condition can be atom, toom, or tomb, but can't be to and ttomm.
Waff has $$$N$$$ books on his bookshelf, and the titles of all the books are strings of lowercase letters only. Now that Waff has selected the book he wants to read, then he wants to know what the longest title he can read is.
The input is guaranteed to have a unique solution.
Line 1: An integer $$$N\ (1 \le N \le 1000)$$$ followed by a legal word, representing the first book he will read.
Line 2 to $$$N+1$$$: Each line contains a legal word less than $$$80$$$ letters long, consisting only of lowercase letters.
A single line contains a word, representing the longest title Waff can read.
7 tom to tom atom atoma tomb tomba tombau
tombau
The reading sequence in testcase: tom, tomb, tomba, tombau.
Aqua and Hiyori love the longest diameter.
Aqua has a sequence $$$a$$$ of length $$$n$$$, and Hiyori want to construct a complete undirected graph which has $$$n$$$ vertices based on the sequence $$$a$$$, which means that the length of edge between $$$u$$$ and $$$v$$$ is $$$\min_{i=\min(u,v)}^{\max(u,v)} a_i$$$. In Aqua's mind, $$$d(u,v)$$$ is described as the longest simple path from $$$u$$$ to $$$v$$$ and she want to know $$$\max_{1\leq u \lt v\leq n} d(u,v)$$$. But she is stupid, could you help her?
There are two lines in the input.
The first line contains a integer $$$n\ (1\leq n\leq 10^6)$$$, represents the number of the piles.
The second line contains $$$n$$$ integers $$$a_1,a_2,...,a_n\ (1\leq a_i\leq 10^9)$$$, represents the sequence $$$a$$$.
Output a single integer — $$$\max_{1\leq u \lt v\leq n} d(u,v)$$$.
3 1 1 1
2
Aqua and Hiyori love subsequences.
Today, Aqua finds a cute tree. A tree is an undirected acyclic graph and this cute tree's root is vertex $$$1$$$. Now, Aqua colors the vertices in the tree and the color of vectex $$$i$$$ is $$$a_i$$$. In order to examine Aqua, Hiyori sets a problem.
A subsequence $$$A$$$ is defined as some sequences like $$$\lbrace u_1,u_2,\cdots,u_k\rbrace(k\geq 1)$$$, and it satisfies that $$$u_i$$$ is $$$u_{i+1}$$$'s ancestor for every $$$i=1,2,\cdots,k-1$$$. Meanwhile, the color of the subsequence $$$A$$$ is $$$\lbrace a_{u_1},a_{u_2},\cdots,a_{u_k}\rbrace$$$.
Define $$$T$$$ as the multiset of all subsequences' color in the tree, and $$$P(T)$$$ as the set of all subsequences' color in the tree. Let $$$v_x$$$ be the number of the subsequence $$$x$$$'s color appearing in $$$T$$$.
Now, Aqua should get $$$\sum_{x\in P(T)} v_x^2$$$. But she is stupid, could you help her?
There are three lines in the input.
The first line contains a integer $$$n\ (1\leq n\leq 5\cdot 10^3)$$$, represents the size of tree.
The second line contains $$$n$$$ integers $$$a_1,a_2,\cdots,a_n\ (0\leq a_i\leq 10^9)$$$, represents the color of vertex $$$i$$$.
The third line contains $$$n-1$$$ integer $$$p_2,p_3,\cdots,p_n\ (1\leq p_i\leq i-1)$$$, represents the father of vertex $$$i$$$.
Print one line. The only line should contain the answer modulo $$$998244353$$$.
3 1 2 3 1 1
5
3 1 1 1 1 1
13
In the second sample, $$$T=\lbrace \lbrace 1\rbrace,\lbrace 1\rbrace,\lbrace 1\rbrace,\lbrace 1,1\rbrace,\lbrace 1,1\rbrace\rbrace, P(T)=\lbrace\lbrace 1\rbrace,\lbrace 1,1\rbrace\rbrace$$$, so the answer is $$$3^2+2^2=13$$$.