Knights tour in Python