class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: A = None
        self.t: E = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.u: D = None
        self.z: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.u: D = None
        self.z: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

m.r = e
m.q = e
m.p = c
m.t = b
m.v = b
j.v = i
j.u = i
j.o = a
j.r = a
j.z = e
e.q = j
e.t = c
e.w = i
e.o = i
i.r = m
i.o = e
i.t = b
i.u = b
b.z = n
b.q = e
b.r = e
b.t = c
c.r = e
c.q = e
c.p = m
c.t = b
c.v = b
a.r = c
a.o = e
a.t = b
a.u = b
n.v = a
n.u = a
n.o = i
n.r = i
n.z = e
assert m.t.z.z.w.r.p.p.q.txt == "e"