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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

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

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

m.z = h
m.s = n
f.s = l
f.q = l
f.o = e
f.t = e
e.w = l
e.q = l
e.s = f
e.x = h
l.q = f
h.u = e
h.w = l
g.s = l
g.q = l
g.o = e
g.t = e
n.u = e
n.w = l
assert m.z.u.s.o.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

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

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

m.z = h
m.s = n
f.s = l
f.q = l
f.o = e
f.t = e
e.w = l
e.q = l
e.s = f
e.x = h
l.q = f
h.u = e
h.w = l
g.s = l
g.q = l
g.o = e
g.t = e
n.u = e
n.w = l
assert m.z.u.s.o.x.u.txt == "e"