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

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

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

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

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

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

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

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

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

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

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

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

h.y = a
h.z = a
a.u = k
a.t = c
a.p = l
b.x = c
b.w = a
b.o = n
b.z = i
b.y = d
k.x = d
k.p = a
c.o = h
c.q = k
c.x = a
l.o = n
l.q = k
l.x = a
i.y = a
i.z = a
n.y = a
n.z = a
d.x = k
d.p = a
assert h.z.p.x.u.p.t.o.z.t.txt == "c"