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

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

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

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

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

e.w = a
e.v = a
e.z = a
e.o = n
n.s = c
n.x = e
a.v = n
c.y = a
assert c.y.v.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

e.w = a
e.v = a
e.z = a
e.o = n
n.s = c
n.x = e
a.v = n
c.y = a
assert c.y.v.x.o.txt == "n"