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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

m.z = l
m.p = l
m.y = c
m.r = a
a.o = e
a.r = l
a.q = l
a.s = l
a.y = m
c.x = m
l.t = e
e.v = a
e.o = a
e.x = c
assert l.t.o.y.y.txt == "c"