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

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

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

l = A("l")
i = B("i")
e = C("e")
f = C("f")
a = B("a")
c = A("c")
d = A("d")
g = B("g")
m = B("m")

l.u = e
l.w = e
i.z = f
e.o = m
e.z = f
e.r = f
f.o = g
f.z = e
f.r = e
a.z = e
c.u = f
c.w = f
d.u = e
d.w = f
g.z = e
m.z = e
assert c.w.z.o.z.o.z.o.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
e = C("e")
f = C("f")
a = B("a")
c = A("c")
d = A("d")
g = B("g")
m = B("m")

l.u = e
l.w = e
i.z = f
e.o = m
e.z = f
e.r = f
f.o = g
f.z = e
f.r = e
a.z = e
c.u = f
c.w = f
d.u = e
d.w = f
g.z = e
m.z = e
assert c.w.z.o.z.o.z.o.z.r.txt == "f"