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

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

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

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

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

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

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

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

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

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

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

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

a.y = l
n.z = c
n.s = l
n.q = d
i.u = c
i.o = n
i.x = d
c.s = i
l.z = i
l.p = i
l.v = i
l.q = d
l.o = n
d.u = c
d.o = n
d.x = i
assert n.z.s.u.s.u.txt == "c"