You are given an N*N digit matrix and you can get several horizontal or vertical digit strings from any position.
In first row, you can get 6 digit strings totally, which are 1,2,3,12,23,123.
In first column, you can get 6 digit strings totally, which are 1,4,7,14,47,147.
We want to get all digit strings from each row and column, and write them on a paper. Now I wonder the sum of all number on the paper if we consider a digit string as a complete decimal number.
The first line contains an integer N. (1 <= N <= 1000)
In the next N lines each line contains a string with N digit.
Output the answer after module 1,000,000,007(1e9+7)。