class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

c = A("c")
l = B("l")
e = C("e")
a = C("a")
j = C("j")
i = B("i")
h = B("h")

c.x = j
l.o = c
l.s = c
l.t = c
e.o = c
a.o = c
j.o = c
i.o = c
i.s = c
i.t = c
h.o = c
h.s = c
h.t = c
assert i.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

c = A("c")
l = B("l")
e = C("e")
a = C("a")
j = C("j")
i = B("i")
h = B("h")

c.x = j
l.o = c
l.s = c
l.t = c
e.o = c
a.o = c
j.o = c
i.o = c
i.s = c
i.t = c
h.o = c
h.s = c
h.t = c
assert i.o.x.o.txt == "c"