Python N-Queens implementation