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

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

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

b = A("b")
n = B("n")
i = C("i")
l = B("l")
k = C("k")
j = C("j")
h = A("h")
e = B("e")
d = C("d")
c = C("c")

b.x = e
n.z = l
i.w = h
l.z = e
k.w = b
j.w = b
h.x = e
e.z = l
d.w = b
c.w = b
assert k.w.x.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

b = A("b")
n = B("n")
i = C("i")
l = B("l")
k = C("k")
j = C("j")
h = A("h")
e = B("e")
d = C("d")
c = C("c")

b.x = e
n.z = l
i.w = h
l.z = e
k.w = b
j.w = b
h.x = e
e.z = l
d.w = b
c.w = b
assert k.w.x.z.z.z.txt == "l"