XOR sum#8647

XOR sum

1 second
128 megabytes
Hard

You have an array of -bit numbers a_1, a_2, \ldots, a_n. You need to calculate

![prb8647.gif](https://static.e-olymp.com/content/7a/7a9f88ce79af92d5a93130e2b4630626d4c810fe.gif)

Operation a + b is bitwise exclusive OR of two numbers and . Since the answer can be very large, output it modulo .

Input

The first line of the input contains three integers , , (1 \le n, k, n \times k \le 300\ 000, 1 \le x \le 3) - length of an array, number of bits in each number and the power of exclusive OR operations results in the sum.

Next lines contain array elements. The -th of them contains string s_0, s_1, \ldots, s_{k-1}, consisting of "" and "". Then

![prb8647_1.gif](https://static.e-olymp.com/content/c3/c3107b00316da88a8810798e492cddd92a4e7166.gif)

Output

Print one number - the remainder of division of the sum of -th powers of exclusive OR results of all pairs of numbers in the array by .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first test case the array contains the numbers [5, 4, 4], and the resulting sum is (5 \mathrm{\ xor}\ 4) + (5 \mathrm{\ xor}\ 4) + (4 \mathrm{\ xor}\ 4) = 1 + 1 + 0 = 2.

In the second test case the array contains the numbers , and the resulting sum is (61 \mathrm{\ xor}\ 38)^3 = 27^3 = 19683.