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

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

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

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

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

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

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

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

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

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

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

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

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