Python implementation of Donald Knuth's Algorithm X with Dancing Links