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

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

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

j = A("j")
l = B("l")
e = C("e")
i = B("i")
f = C("f")
k = B("k")

j.z = e
l.u = e
e.w = i
i.u = f
f.w = l
k.u = f
assert l.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

j = A("j")
l = B("l")
e = C("e")
i = B("i")
f = C("f")
k = B("k")

j.z = e
l.u = e
e.w = i
i.u = f
f.w = l
k.u = f
assert l.u.w.u.txt == "f"