class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: E = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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