class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

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

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

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

c = A("c")
f = B("f")
l = C("l")
m = D("m")
e = B("e")

c.t = m
c.x = m
c.u = m
f.u = e
f.y = e
f.z = m
l.z = f
m.o = e
m.y = l
e.u = f
e.y = f
e.z = m
assert f.z.o.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

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

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

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

c = A("c")
f = B("f")
l = C("l")
m = D("m")
e = B("e")

c.t = m
c.x = m
c.u = m
f.u = e
f.y = e
f.z = m
l.z = f
m.o = e
m.y = l
e.u = f
e.y = f
e.z = m
assert f.z.o.u.z.txt == "m"