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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

e.r = l
n.s = j
n.z = j
n.q = j
n.u = m
n.t = m
j.r = n
m.y = l
m.o = j
m.z = e
l.p = j
l.s = j
l.x = m
a.s = j
a.z = j
a.q = j
a.u = m
a.t = m
assert m.z.r.x.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

e.r = l
n.s = j
n.z = j
n.q = j
n.u = m
n.t = m
j.r = n
m.y = l
m.o = j
m.z = e
l.p = j
l.s = j
l.x = m
a.s = j
a.z = j
a.q = j
a.u = m
a.t = m
assert m.z.r.x.z.r.txt == "l"