Euler's Officers

How many different ways can you arrange the officers in a square?
Exploring and noticing Working systematically Conjecturing and generalising Visualising and representing Reasoning, convincing and proving
Being curious Being resourceful Being resilient Being collaborative

Problem



How many different solutions can you find to this problem?

Arrange 25 officers, each having one of five different ranks $a$, $b$, $c$, $d$ and $e$, and belonging to one of five different regiments $p$, $q$, $r$, $s$ and $t$, in a square formation 5 by 5, so that each row and each file contains just one officer of each rank and just one from each regiment.