class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.q: C = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

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

c = A("c")
f = B("f")
m = C("m")
d = D("d")
a = E("a")
n = D("n")

c.u = a
f.z = a
m.z = d
m.t = d
m.p = f
m.s = a
d.s = a
d.v = m
d.q = m
d.o = m
d.u = c
a.y = f
n.s = a
n.v = m
n.q = m
n.o = m
n.u = c
assert c.u.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.t: D = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: C = None
        self.q: C = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

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

c = A("c")
f = B("f")
m = C("m")
d = D("d")
a = E("a")
n = D("n")

c.u = a
f.z = a
m.z = d
m.t = d
m.p = f
m.s = a
d.s = a
d.v = m
d.q = m
d.o = m
d.u = c
a.y = f
n.s = a
n.v = m
n.q = m
n.o = m
n.u = c
assert c.u.y.z.txt == "a"