Frightful Formula#7777

Frightful Formula

1 second
128 megabytes
Very easy

A frightful matrix is a square matrix of order where the first row and the first column are explicitly specified, while the other elements are calculated using a frightful formula which is, actually, a simple recursive rule.

Given two integer sequences and , both of size , as well as integer parameters , and , the frightful matrix is defined as follows:

F[i, j] = a \cdot F[i, j - 1] + b \cdot F[i - 1, j] + c

Given a frightful matrix, find the value of the element F[n, n] modulo 10^6 + 3.

Input

The first line contains four integers n, a, b and c~(2 \le n \le 200000, 0 \le a, b, c \le 10^6) — the size of the matrix and the recursion parameters, as described in the problem statement.

The two following lines contain integers l_1, ..., l_n and t_1, ..., t_n, respectively (l_1 = t_1, 0 \le l_k, t_k \le 10^6).

Output

Output a single integer — the value of F[n, n] modulo 10^6 + 3.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading