Give a positive interger n and matrix \(A=(a_{ij})_{m*m}\). The task is to cal An%(109+7).
Input:
- The firsst line contains 2 positive interger n (n<=1018) and m(m<=10).
- m lines folows contains matrix \(A=(a_{ij})_{m*m}, |a_{ij}|\leq10\)
Output: m line print matrix An%(109+7).