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

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

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

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

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

e = A("e")
m = B("m")
k = C("k")
n = D("n")
b = E("b")

e.r = m
e.o = m
e.y = b
m.s = e
m.q = k
k.p = m
k.z = b
n.q = e
n.x = b
b.y = n
b.z = n
b.t = k
b.w = k
b.o = m
assert n.q.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

e = A("e")
m = B("m")
k = C("k")
n = D("n")
b = E("b")

e.r = m
e.o = m
e.y = b
m.s = e
m.q = k
k.p = m
k.z = b
n.q = e
n.x = b
b.y = n
b.z = n
b.t = k
b.w = k
b.o = m
assert n.q.y.o.txt == "m"