You are given N^2 decimal digits from to .
Consider arranging these digits in an N \times N square grid, placing one digit in each cell. Reading each row from left to right forms a decimal representation of an -digit number. Similarly, reading each column from top to bottom also forms a decimal representation of an -digit number. Let be the sum of all numbers from the rows and all numbers from the columns.
Arrange the digits in the grid so that is maximized.
The first line contains an integer (1 \leq N \leq 8). The second line contains N^2 decimal digits from to , written consecutively without separators.
Print the maximum possible value of .
Example 1