Limits 1s, 64 MB

Once upon a time, in a land far, far away, there was an enchanting ICPC contest. The contest organizers were fascinated by the magic of prime numbers. They devised a challenge involving prime factored numbers!

In this enchanted world, they provided two arrays of size nn, aa and bb, where a=[a1,a2,a3,an]a = [a_1, a_2, a_3, … a_n] and b=[b1,b2,b3,bn]b = [b_1, b_2, b_3, … b_n] These arrays held the secret to a powerful number. The original number was conjured using the formula:

a1b1a2b2a3b3...anbn{a_1}^{b_1} * {a_2} ^ {b_2} * {a_3}^{b_3}... {a_n}^{b_n}

But wait, there was more! The enchanters also provided another magical number, MODMOD. They needed a spell to find the result of the given number modulo MODMOD.

Help them to find the parity and count of digits of the number of divisors of the number.

Look at the sample output for more clarification.

Input

The mystical input includes the following:

First line contains an integer nn — representing the size of the arrays.

Second line contains nn space-separated prime integers a1,a2,a2ana_1, a_2, a_2 … a_n — epresenting the base of the prime factors.

Third line contains nn space-separated integers b1,b2,b3,bnb_1, b_2, b_3, … b_n — representing the exponent of the prime factors.

Last line contains a prime integer MODMOD — representing the modulus.

1n1051≤n≤10^5

1ai10181≤a_i≤10^{18}

1bi10121≤b_i≤10^{12}

1MOD1091≤MOD≤10^9

Output

Your task is to conjure the result of the given number as described above, but with an added touch of magic - find it modulo MOD!

The output will contain three lines: the first line contains the desired number and the second line is the parity of the count of divisors of that number. If even print “Even” else print “Odd” (without the quotes) and lastly the number of digits in the number of divisors of the number. Look at the sample output for more information.

Sample

InputOutput
5
2 3 2 3 5
1 2 2 1 2
11
10
Even
2

Be careful about the output formatting and newline (‘\n’) at the end.

Submit

Login to submit.

Statistics

40% Solution Ratio
sourov.cseEarliest, 4M ago
mdmmmoniruzzamanFastest, 0.0s
mdmmmoniruzzamanLightest, 5.2 MB
sourov.cseShortest, 1451B
Toph uses cookies. By continuing you agree to our Cookie Policy.