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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

e.t = k
e.v = b
e.z = b
e.s = c
c.p = e
b.o = c
b.y = f
k.v = c
k.w = f
i.v = c
f.v = c
f.w = k
assert k.v.p.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

e.t = k
e.v = b
e.z = b
e.s = c
c.p = e
b.o = c
b.y = f
k.v = c
k.w = f
i.v = c
f.v = c
f.w = k
assert k.v.p.s.p.s.txt == "c"