#Pyth, 34 31 25 bytes
Pyth, 34 31 25 bytes
h+fqQ+;s*VT[1 2.5 5;)yMM^U4 4]*4]0yMh+fqQ+;s*VT[2 5;y;)^U4 4]*4]0yMhfqQ+;s*VT[2 5;y;)^U4 4
Errors in impossibility.
This is essentially a brute-force.
This is quite fast, since there are only 256 possible arrangements.