public void output() {
        for (int i = 1; i <= dimension; i++)
            System.out.print(queens[i] + " ");
        System.out.println();
        for (int i = 1; i <= dimension; i++) {
            for (int j = 1; j <= dimension; j++) {
                if (j == queens[i])
                    System.out.print("* ");
                else
                    System.out.print("- ");
            }
            System.out.println();
        }
        for (int i = 1; i <= dimension; i++)
            System.out.println(queens[i]);
        validate();
    }