puzzle solution in django