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

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

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

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

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

a = A("a")
d = B("d")
n = C("n")
m = D("m")
f = E("f")
e = E("e")
b = B("b")
h = A("h")
j = B("j")
l = A("l")

a.s = b
a.r = n
a.z = l
a.y = m
d.u = l
d.z = l
d.y = n
d.x = n
d.p = n
n.u = j
n.s = m
n.z = d
m.w = e
m.p = h
m.r = n
f.z = n
f.u = n
e.z = n
e.u = n
b.u = a
b.z = a
b.y = n
b.x = n
b.p = n
h.s = b
h.r = n
h.z = l
h.y = m
j.u = a
j.y = n
j.x = n
j.p = n
j.z = l
l.s = b
l.r = n
l.z = h
l.y = m
assert m.r.s.r.s.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: C = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

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

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

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

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

a = A("a")
d = B("d")
n = C("n")
m = D("m")
f = E("f")
e = E("e")
b = B("b")
h = A("h")
j = B("j")
l = A("l")

a.s = b
a.r = n
a.z = l
a.y = m
d.u = l
d.z = l
d.y = n
d.x = n
d.p = n
n.u = j
n.s = m
n.z = d
m.w = e
m.p = h
m.r = n
f.z = n
f.u = n
e.z = n
e.u = n
b.u = a
b.z = a
b.y = n
b.x = n
b.p = n
h.s = b
h.r = n
h.z = l
h.y = m
j.u = a
j.y = n
j.x = n
j.p = n
j.z = l
l.s = b
l.r = n
l.z = h
l.y = m
assert m.r.s.r.s.p.z.txt == "l"