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

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

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

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

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

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

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

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

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

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

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

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

e.y = i
e.t = b
e.z = n
b.p = k
b.t = n
n.u = e
k.z = e
k.o = n
k.x = n
k.w = i
k.r = b
i.y = e
i.o = k
assert n.u.y.y.t.txt == "b"