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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

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

m.z = d
m.s = n
m.w = n
m.u = f
m.y = a
j.z = h
j.w = f
j.t = e
f.w = j
f.r = h
a.u = j
a.q = j
a.w = n
a.z = n
a.s = d
e.r = a
e.w = m
e.x = h
n.z = h
n.w = f
n.t = e
h.z = f
h.u = f
h.s = j
h.w = n
h.y = a
d.w = n
d.r = m
assert h.z.w.z.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.w: B = None
        self.u: C = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

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

m.z = d
m.s = n
m.w = n
m.u = f
m.y = a
j.z = h
j.w = f
j.t = e
f.w = j
f.r = h
a.u = j
a.q = j
a.w = n
a.z = n
a.s = d
e.r = a
e.w = m
e.x = h
n.z = h
n.w = f
n.t = e
h.z = f
h.u = f
h.s = j
h.w = n
h.y = a
d.w = n
d.r = m
assert h.z.w.z.z.r.txt == "h"