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

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

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

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

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

e = A("e")
c = B("c")
i = C("i")
k = D("k")
d = E("d")

e.z = c
e.v = c
e.w = i
c.y = d
c.p = k
c.s = k
c.z = i
c.u = i
i.p = k
i.q = e
k.p = e
k.w = i
d.y = i
assert i.q.v.p.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

e = A("e")
c = B("c")
i = C("i")
k = D("k")
d = E("d")

e.z = c
e.v = c
e.w = i
c.y = d
c.p = k
c.s = k
c.z = i
c.u = i
i.p = k
i.q = e
k.p = e
k.w = i
d.y = i
assert i.q.v.p.p.w.txt == "i"