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

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

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

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

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

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

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

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

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

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

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

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

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