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

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

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

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

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

j = A("j")
c = B("c")
h = C("h")
e = D("e")
m = E("m")
i = A("i")
d = C("d")
n = A("n")

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

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

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

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

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

j = A("j")
c = B("c")
h = C("h")
e = D("e")
m = E("m")
i = A("i")
d = C("d")
n = A("n")

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