class Person { var children: MutableList<Person> = mutableListOf<>() constructor(parent: Person) { parent.children.add(this) } }