public void print(String ans, int leftCount, int rightCount) {

        if (leftCount == 0 && rightCount == 0) {
            System.out.println(ans);
            return;
        }

        if (leftCount > 0) {
            print(ans + "(", leftCount - 1, rightCount);
        }

        if (rightCount > leftCount) {
            print(ans + ")", leftCount, rightCount - 1);
        }
    }