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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

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

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

e.w = a
a.o = k
g.w = a
g.v = c
g.z = m
g.t = i
c.q = i
c.o = a
c.z = a
c.t = n
h.t = m
h.r = c
k.q = h
k.o = a
k.z = a
k.t = e
n.w = a
m.w = a
i.t = e
i.r = k
assert m.w.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

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

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

e.w = a
a.o = k
g.w = a
g.v = c
g.z = m
g.t = i
c.q = i
c.o = a
c.z = a
c.t = n
h.t = m
h.r = c
k.q = h
k.o = a
k.z = a
k.t = e
n.w = a
m.w = a
i.t = e
i.r = k
assert m.w.o.z.txt == "a"