ublic class Solution { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String grandFatherName = reader.readLine(); Cat catGrandFather = new Cat(grandFatherName); String grannyName = reader.readLine(); Cat catGranny = new Cat(grannyName); String fatherName = reader.readLine(); Cat catFather = new Cat(fatherName, catGrandFather); String motherName = reader.readLine(); Cat catMother = new Cat(motherName, catGranny); String sonName = reader.readLine(); Cat catSon = new Cat(sonName, catMother,catFather); String daughterName = reader.readLine(); Cat catDaughter = new Cat(daughterName, catMother, catFather); System.out.println(catGrandFather); System.out.println(catGranny); System.out.println(catFather); System.out.println(catMother); System.out.println(catSon); System.out.println(catDaughter); } public static class Cat { private String name; private Cat parent; private Cat mother; private Cat father; Cat(String name) { this.name = name; } Cat(String name, Cat mother) { this.name = name; if(mother != null) this.parent = mother; else this.parent = father; } Cat(String name, Cat mother, Cat father) { this.name = name; this.parent = mother; this.parent = father; } @Override public String toString() { if (parent.mother == null && parent.father == null) return "The cat's name is " + name + ", no mother, " + " no father"; if (parent.mother != null && parent.father == null) return "the cat's name is " + name + ", mother is " + mother.name + " no father"; else return "the cat's name is " + name + ", mother is " + mother.name + "father is " + father.name; } } } При попытке компиляции выкидывает ошибку Нулл поинтер. Подскажите что не так, пожалуйста