Solution
2 4 4 1 1
2 4 4 1 5
2 2 3 1 5
3 3 3 5 5