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

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

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

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

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

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

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

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

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

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

k.s = d
k.v = b
k.u = b
k.w = i
i.u = d
i.p = d
b.p = i
b.o = k
d.z = c
d.x = k
d.t = k
d.y = k
c.u = d
c.p = d
assert i.p.x.w.u.z.txt == "c"