Given a matrix of natural numbers, a natural number and a natural number , compute . To avoid overflows, compute every element of .
Input consists of several cases, each with , , and in this order, followed by and . Assume that the elements of are not larger than , , and .
For every case, print the elements of in two lines following the format of the sample. Print a line with 10 dashes after every matrix.
Input
2 7 1 4 2 100 2 7 1 4 2 5 15 2 3 4 0 1000 500 499 499 498 123456789 1000
Output
11 42 6 23 ---------- 1 2 1 3 ---------- 1 0 0 1 ---------- 792 815 815 422 ----------