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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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