ROSECODE 196
A special grid
Consider an NxN grid (N<16) where hex digits 1 to N
are used only once in each row or column and treat
the whole grid as a number starting from first row
to the last.
What is the smallest number for N=13?
Answer format: last 2 rows as uppercase hex
Example for N=5:
1, 2, 3, 4, 5
2, 1, 4, 5, 3
3, 4, 5, 1, 2
4, 5, 2, 3, 1
5, 3, 1, 2, 4
Number=1234521453345124523153124
Answer=4523153124