Due to the recent popularity of the Deep learning new countries are starting to look like Neural Networks. That is, the countries are being built deep with many layers, each layer possibly having many cities. They also have one entry, and one exit point.
There are exactly _L_ layers, each having _N_ cities. Let us look at the two adjacent layers _L_1 and _L_2. Each city from the layer _L_1 is connected to each city from the layer _L_2 with the traveling cost _c__ij_ for , and each pair of adjacent layers has the same cost in between their cities as any other pair (they just stacked the same layers, as usual). Also, the traveling costs to each city from the layer _L_2 are same for all cities in the _L_1, that is _c__ij_ is the same for , and fixed _j_.
Doctor G. needs to speed up his computations for this country so he asks you to find the number of paths he can take from entry to exit point such that his traveling cost is divisible by given number _M_.
## Input
The first line of input contains _N_ (1 ≤ _N_ ≤ 106), _L_ (2 ≤ _L_ ≤ 105) and _M_ (2 ≤ _M_ ≤ 100), the number of cities in each layer, the number of layers and the number that travelling cost should be divisible by, respectively.
Second, third and fourth line contain _N_ integers each denoting costs 0 ≤ _cost_ ≤ _M_ from entry point to the first layer, costs between adjacent layers as described above, and costs from the last layer to the exit point.
## Output
Output a single integer, the number of paths Doctor G. can take which have total cost divisible by _M_, modulo 109 + 7.
[samples]
## Note

This is a country with 3 layers, each layer having 2 cities. Paths , and are the only paths having total cost divisible by 13. Notice that input edges for layer cities have the same cost, and that they are same for all layers.
由于深度学习的流行,新国家开始呈现出神经网络的形态。也就是说,这些国家是深度构建的,具有许多层,每层可能包含许多城市。它们只有一个入口和一个出口。
恰好有 #cf_span[L] 层,每层有 #cf_span[N] 个城市。考虑两个相邻层 #cf_span[L1] 和 #cf_span[L2]。层 #cf_span[L1] 中的每个城市都与层 #cf_span[L2] 中的每个城市相连,旅行代价为 #cf_span[cij],且任意两相邻层之间的城市代价都相同(它们只是简单地堆叠了相同的层,如常)。此外,对于层 #cf_span[L2] 中的每个城市 #cf_span[j],所有来自层 #cf_span[L1] 的城市到它的旅行代价都相同,即对于固定的 #cf_span[j],所有 #cf_span[cij] 相等。
医生 G. 需要加速他对该国的计算,因此他要求你找出从入口到出口的路径数量,使得总旅行代价能被给定数 #cf_span[M] 整除。
输入的第一行包含 #cf_span[N (1 ≤ N ≤ 106)], #cf_span[L (2 ≤ L ≤ 105)] 和 #cf_span[M (2 ≤ M ≤ 100)],分别表示每层的城市数、层数和旅行代价需被整除的数。
第二、三、四行各包含 #cf_span[N] 个整数,分别表示从入口到第一层的代价、相邻层之间的代价(如上所述),以及从最后一层到出口的代价。
请输出一个整数,表示医生 G. 可以选择的总代价能被 #cf_span[M] 整除的路径数量,对 #cf_span[109 + 7] 取模。
## Input
输入的第一行包含 #cf_span[N (1 ≤ N ≤ 106)], #cf_span[L (2 ≤ L ≤ 105)] 和 #cf_span[M (2 ≤ M ≤ 100)],分别表示每层的城市数、层数和旅行代价需被整除的数。第二、三、四行各包含 #cf_span[N] 个整数,分别表示从入口到第一层的代价、相邻层之间的代价(如上所述),以及从最后一层到出口的代价。
## Output
请输出一个整数,表示医生 G. 可以选择的总代价能被 #cf_span[M] 整除的路径数量,对 #cf_span[109 + 7] 取模。
[samples]
## Note
这是一个具有 #cf_span[3] 层、每层有 #cf_span[2] 个城市的国家。路径 , 和 是唯一总代价能被 #cf_span[13] 整除的路径。注意,各层城市之间的输入边代价相同,且所有层间代价均一致。
**Definitions**
Let $ N, L, M \in \mathbb{Z}^+ $ with $ 1 \leq N \leq 10^6 $, $ 2 \leq L \leq 10^5 $, $ 2 \leq M \leq 100 $.
Let $ \mathbf{e} = (e_1, \dots, e_N) \in \{0, 1, \dots, M\}^N $ be the cost vector from the entry point to each city in layer 1.
Let $ \mathbf{c} = (c_1, \dots, c_N) \in \{0, 1, \dots, M\}^N $ be the cost vector from any city in layer $ \ell $ to each city in layer $ \ell+1 $, for $ 2 \leq \ell \leq L-1 $.
Let $ \mathbf{x} = (x_1, \dots, x_N) \in \{0, 1, \dots, M\}^N $ be the cost vector from each city in layer $ L $ to the exit point.
**Constraints**
All costs are integers in $ [0, M] $.
**Objective**
Count the number of paths from entry to exit, passing through exactly one city per layer, such that the total cost is congruent to $ 0 \mod M $, where:
- The path cost is $ e_i + \sum_{\ell=1}^{L-1} c_{j_\ell} + x_k $,
- $ i, j_1, \dots, j_{L-1}, k \in \{1, \dots, N\} $,
- Each transition from layer $ \ell $ to $ \ell+1 $ uses the same cost vector $ \mathbf{c} $,
- The total number of such paths modulo $ 10^9 + 7 $.
Formally, compute:
$$
\left| \left\{ (i, j_1, \dots, j_{L-2}, k) \in [N]^{L} \,\middle|\, e_i + \sum_{\ell=1}^{L-1} c_{j_\ell} + x_k \equiv 0 \pmod{M} \right\} \right| \mod (10^9 + 7)
$$
where $ j_1 $ indexes the city in layer 2, $ j_2 $ in layer 3, ..., $ j_{L-1} $ in layer $ L $.