2016
题号:NC52812
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Given a matrix

find where .
As the result may be large,
you are going to find only the remainder after division by 7.

*Special Note*:
The problem is intended to be easy.
Feel free to think why the problem is called `2016` if you either:

1. find it hard to solve;
2. or, solved all the other problems easily.

输入描述:

The input contains at most 40 sets. For each set:
The first line contains an integer n ().
The second line contains 2 integers .
The third line contains 2 integers .
(, is not a multiple of 7)

输出描述:

For each set, a  matrix denotes the remainder of  after division by 7.
示例1

输入

复制
2
1 1
1 2

输出

复制
2 3
3 5
示例2

输入

复制
2016
1 1
1 2

输出

复制
1 0
0 1