solve N-queens