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

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

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

l = A("l")
n = B("n")
e = C("e")
k = C("k")
j = B("j")
b = B("b")
f = B("f")
m = C("m")

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

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

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

l = A("l")
n = B("n")
e = C("e")
k = C("k")
j = B("j")
b = B("b")
f = B("f")
m = C("m")

l.z = e
n.w = l
e.u = n
k.u = j
j.w = l
b.w = l
f.w = l
m.u = n
assert m.u.w.z.u.w.z.u.w.txt == "l"