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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

c = A("c")
n = B("n")
k = C("k")
e = D("e")
a = E("a")

c.z = n
c.v = a
c.q = k
c.t = e
n.w = e
k.t = a
k.r = c
e.r = c
e.z = n
e.s = a
a.o = e
a.v = e
a.z = k
assert e.z.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

c = A("c")
n = B("n")
k = C("k")
e = D("e")
a = E("a")

c.z = n
c.v = a
c.q = k
c.t = e
n.w = e
k.t = a
k.r = c
e.r = c
e.z = n
e.s = a
a.o = e
a.v = e
a.z = k
assert e.z.w.r.txt == "c"