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

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

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

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

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

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

e.z = d
e.w = l
e.o = c
n.v = e
n.q = e
n.z = a
d.t = a
a.r = c
a.q = d
l.y = d
c.y = d
assert l.y.t.r.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

e.z = d
e.w = l
e.o = c
n.v = e
n.q = e
n.z = a
d.t = a
a.r = c
a.q = d
l.y = d
c.y = d
assert l.y.t.r.y.t.txt == "a"