Fill each row and column with digits 1 through N without repeating, while satisfying the inequality constraints.