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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.y: C = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.x: A = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.y: C = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.x: A = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.r: A = None
        self.txt = txt

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

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

j.r = e
j.u = e
j.q = i
j.v = m
i.v = b
i.s = b
i.x = e
i.y = e
i.t = e
e.p = a
e.o = a
e.s = j
e.x = j
d.p = j
d.r = j
d.o = m
a.y = m
a.z = m
a.q = j
a.v = d
a.x = i
m.p = j
m.r = j
m.o = d
b.v = i
b.s = i
b.x = e
b.y = e
b.t = e
assert b.s.x.o.y.o.r.u.txt == "e"