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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

a.z = l
a.o = l
a.r = e
l.r = k
l.w = n
k.t = l
k.p = l
k.r = h
k.w = n
k.u = n
n.y = h
n.w = l
n.s = a
e.s = k
e.y = k
e.z = k
e.w = n
h.t = l
h.p = l
h.r = k
h.w = n
h.u = n
assert h.w.s.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

a.z = l
a.o = l
a.r = e
l.r = k
l.w = n
k.t = l
k.p = l
k.r = h
k.w = n
k.u = n
n.y = h
n.w = l
n.s = a
e.s = k
e.y = k
e.z = k
e.w = n
h.t = l
h.p = l
h.r = k
h.w = n
h.u = n
assert h.w.s.o.r.txt == "k"