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

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.s: B = None
        self.o: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.s: B = None
        self.o: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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