Background
The death is a funny thing. It is discussed only by the ones, who never died, while those, who are already dead, prefer keeping silence. That is why few people know, what exactly happens with a human after his death. A body is undoubtedly remains under ground forever... But the way of a soul was discovered only by Anton Hamster, who was a disciple of legendary Vasily Slipman (you may look through the problems
"Jedi riddle" and
"Jedi riddle 2" for more information about Mr. Slipman).
Mr. Hamster carried out a sequence of experiments and found out, that, however it sounds pity, a soul neither soars into the sky nor falls under ground. It just finds oneself at one of the countless levels of the Twilight, where it is condemned to stay till the end of time. In theory, a soul may be returned into the Real World and resurrected in a new body. The only question is how to do it...
Problem
Surely, Anton knew, that it was possible to get to any level of the Twilight straight from the Real World. You should only know a Key  and the Gates of the Twilight will open before you. Inter vivos, Mr. Slipman himself visited N first levels using N Keys K_{i} he found by brute force. But Vasily failed to find the Key to the (N+1)th and the following levels. He just made a remark, that one had to use N Shift Numbers C_{i} and the Modular Number Y.
But Mr. Hamster could excel his Teacher and succeeded in finding a universal formula for the Key K_{i} to the Gates of any level of the Twilight. Here is the formula: K_{i} = (K_{i1}*C_{N} + K_{i2}*C_{N1} + K_{i3}*C_{N2} + ... + K_{iN}*C_{1}) modulo Y.
And now Anton wants to organize the second coming of Mr. Slipman into our sinful world. The only thing he needs is to calculate the Key to the Gates of the Twilight's Xth level, where the Teacher's soul is concealed in expectation of freedom.
Input
The first line contains the integer numbers N (1 ≤ N ≤ 100), X (N < X < 2^{28}) and Y (2 ≤ Y < 2^{28}). The second line contains N integer Keys K_{i} (0 ≤ K_{i} ≤ 100). The third line contains N integer Shift Numbers C_{i} (0 ≤ C_{i} ≤ 1).
Output
You should output the desired Key K_{X}.
Sample
input  output 

3 6 73
12 91 65
1 1 0
 22

Problem Author: Ilya Grebnov, Nikita Rybak, Dmitry Kovalioff
Problem Source: Timus Top Coders: Third Challenge