Like this:

3 responses to “Enigma 1476: Portuguese squares”

Originally I searched the squares and matched up the letters, which may be a bit faster (it ran in 35ms), but my normal way of using itertools.permutations() results in a more compact program, and it runs in 36ms.