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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

h = A("h")
f = B("f")
e = C("e")
a = D("a")
m = E("m")

h.t = e
h.s = a
f.w = e
f.z = e
f.y = e
f.o = h
e.z = m
a.u = m
m.y = e
m.v = e
m.s = e
m.x = f
m.o = a
assert m.x.o.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

h = A("h")
f = B("f")
e = C("e")
a = D("a")
m = E("m")

h.t = e
h.s = a
f.w = e
f.z = e
f.y = e
f.o = h
e.z = m
a.u = m
m.y = e
m.v = e
m.s = e
m.x = f
m.o = a
assert m.x.o.s.u.txt == "m"