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

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

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

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

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

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

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

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

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

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

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

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

i.z = b
i.s = m
i.y = m
b.q = m
g.r = n
g.z = n
g.p = a
g.q = h
h.z = d
h.t = n
h.w = l
h.p = a
h.y = b
l.x = m
l.y = g
l.u = a
d.z = b
d.s = m
d.y = i
j.z = d
j.t = l
j.w = l
j.p = g
j.y = b
m.z = b
m.s = d
m.y = i
a.r = n
a.z = n
a.p = g
a.q = j
n.x = d
n.y = g
n.u = a
assert a.q.z.s.z.q.s.z.q.z.q.txt == "m"