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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.u: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

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

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

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

e = A("e")
m = B("m")
g = C("g")
h = D("h")
l = E("l")

e.z = g
e.w = g
e.o = g
e.u = m
m.r = h
m.v = g
m.u = e
m.o = e
m.t = e
g.u = h
g.q = m
g.o = e
h.w = m
l.s = g
assert l.s.o.w.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.u: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

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

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

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

e = A("e")
m = B("m")
g = C("g")
h = D("h")
l = E("l")

e.z = g
e.w = g
e.o = g
e.u = m
m.r = h
m.v = g
m.u = e
m.o = e
m.t = e
g.u = h
g.q = m
g.o = e
h.w = m
l.s = g
assert l.s.o.w.o.u.txt == "m"