This program implements the "Word Rectangles" example from The Art of Computer Programming, Volume 4 Fascicle 5, Chapter 7.2.2.

Given an input file containing a list of five-letter words (for example, from Knuth's Stanford Graphbase), this program uses a backtracking search to produce all 5x5 squares where each column is a unique word from the file, and each row is also a word from the file.

Some example output:

about
torte
lotta
ashes
store

about
batty
other
utero
tyros