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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.t: A = None
        self.p: E = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.s: C = None
        self.o: B = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.t: A = None
        self.p: E = None
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.s: C = None
        self.o: B = None
        self.v: B = None
        self.txt = txt

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

a.x = l
m.q = e
m.s = a
m.t = a
m.o = a
m.p = l
d.u = i
d.p = c
d.z = l
c.q = d
c.t = i
c.r = i
c.s = n
l.w = e
l.o = e
l.v = e
l.t = b
l.s = d
b.q = n
b.s = n
b.t = i
b.r = d
e.q = m
e.s = a
e.t = a
e.o = a
e.p = l
i.u = d
i.p = c
i.z = l
n.u = i
n.p = c
n.z = l
assert a.x.s.z.o.s.x.txt == "l"