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

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

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

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

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

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

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

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

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

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

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

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

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