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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

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

e.r = n
e.v = n
e.w = a
e.s = m
m.x = a
a.z = f
a.p = d
a.x = k
b.p = a
b.z = a
b.v = e
b.y = c
k.o = f
k.r = f
k.t = c
k.y = m
f.o = k
f.r = k
f.t = d
f.y = m
n.r = e
n.v = e
n.w = a
n.s = m
c.p = a
c.z = a
c.v = n
c.y = b
d.p = a
d.z = a
d.v = e
d.y = b
assert a.z.y.x.x.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.w: C = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

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

e.r = n
e.v = n
e.w = a
e.s = m
m.x = a
a.z = f
a.p = d
a.x = k
b.p = a
b.z = a
b.v = e
b.y = c
k.o = f
k.r = f
k.t = c
k.y = m
f.o = k
f.r = k
f.t = d
f.y = m
n.r = e
n.v = e
n.w = a
n.s = m
c.p = a
c.z = a
c.v = n
c.y = b
d.p = a
d.z = a
d.v = e
d.y = b
assert a.z.y.x.x.r.y.txt == "m"