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

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: C = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: C = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

a.u = d
a.o = e
a.z = k
d.q = h
d.p = k
i.q = k
i.x = k
i.z = e
i.y = m
e.w = k
e.q = k
e.o = d
e.u = d
e.y = d
n.t = i
n.z = i
n.v = e
n.s = d
h.t = i
h.z = k
h.v = e
h.s = d
m.u = d
m.o = e
m.z = i
c.t = k
c.z = i
c.v = e
c.s = d
k.q = i
k.x = i
k.z = e
k.y = m
assert i.z.u.q.z.z.o.p.txt == "k"