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

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

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

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

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

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

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

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

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

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

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

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

m.p = e
m.o = c
m.t = c
m.w = h
j.z = b
j.y = m
k.t = m
a.q = e
a.t = e
a.z = b
a.r = k
e.v = h
e.q = m
h.t = m
b.z = j
b.y = m
c.q = d
c.t = d
c.z = j
c.r = k
d.v = h
d.q = m
assert m.p.v.t.p.q.t.r.t.p.txt == "e"