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

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

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

b = A("b")
c = B("c")
d = C("d")
e = B("e")
l = C("l")
i = A("i")

b.x = e
c.o = l
d.s = l
e.o = l
l.s = d
i.x = c
assert i.x.o.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

b = A("b")
c = B("c")
d = C("d")
e = B("e")
l = C("l")
i = A("i")

b.x = e
c.o = l
d.s = l
e.o = l
l.s = d
i.x = c
assert i.x.o.s.s.txt == "l"