public class Solution {
    public static void main(String[] args) {
        Human ded = new Human("Oleg",true,25);
        Human babushka = new Human("Kolia",true,30);
        Human ded1 = new Human("Anna",false,33);
        Human babushka1 = new Human("Jozia",false,56);

        Human otec = new Human("Jeri",true,15,ded,babushka);
        Human mat = new Human("Anuta",true,41,ded1,babushka1);
        Human son = new Human("Koliak",true,10,ded,babushka);
        Human son1 = new Human("Kirill",false,10,ded1,babushka1);
        Human dota = new Human("Jizia",false,30,ded,babushka);

        System.out.println(ded);
        System.out.println(babushka);
        System.out.println(ded1);
        System.out.println(babushka1);
        System.out.println(otec);
        System.out.println(mat);
        System.out.println(son);
        System.out.println(son1);
        System.out.println(dota);
    }

    public static class Human {
        String name;
        boolean sex;
        int age;
        Human father;
        Human mother;
        public Human(String name,boolean sex,int age){

        }
        public Human(String name,boolean sex,int age,Human father,Human mother){

        }
        public String toString() {
            String text = "";
            text += "Имя: " + this.name;
            text += ", пол: " + (this.sex ? "мужской" : "женский");
            text += ", возраст: " + this.age;

            if (this.father != null) {
                text += ", отец: " + this.father.name;
            }

            if (this.mother != null) {
                text += ", мать: " + this.mother.name;
            }

            return text;
        }
    }
}