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

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

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

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

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

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

a.y = h
a.z = h
a.t = n
a.u = n
a.r = l
l.z = h
l.q = a
n.x = l
n.v = h
h.z = l
e.v = h
e.p = l
assert h.z.q.r.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.z: D = None
        self.r: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

a.y = h
a.z = h
a.t = n
a.u = n
a.r = l
l.z = h
l.q = a
n.x = l
n.v = h
h.z = l
e.v = h
e.p = l
assert h.z.q.r.z.z.txt == "l"