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

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

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

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

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

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

j.p = b
j.q = b
j.u = c
j.s = e
c.z = j
c.y = e
b.y = h
b.p = d
b.t = d
b.z = k
b.s = k
m.z = b
h.s = e
h.z = e
f.p = b
f.q = b
f.u = c
f.s = e
d.z = f
d.y = h
k.z = b
e.s = h
e.z = h
n.z = b
assert m.z.z.z.t.y.s.z.z.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.q: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

j.p = b
j.q = b
j.u = c
j.s = e
c.z = j
c.y = e
b.y = h
b.p = d
b.t = d
b.z = k
b.s = k
m.z = b
h.s = e
h.z = e
f.p = b
f.q = b
f.u = c
f.s = e
d.z = f
d.y = h
k.z = b
e.s = h
e.z = h
n.z = b
assert m.z.z.z.t.y.s.z.z.s.z.txt == "e"