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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

e.r = c
e.x = i
e.t = d
e.w = b
b.s = h
b.q = j
b.p = e
m.t = c
m.w = e
a.t = b
a.s = d
a.q = i
a.o = m
a.x = e
h.o = b
c.t = m
c.w = e
i.t = b
i.s = h
i.q = j
i.o = m
i.x = e
j.t = b
j.s = h
j.q = a
j.o = c
j.x = e
d.o = b
assert d.o.p.x.q.s.txt == "h"