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

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

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

n = A("n")
a = B("a")
e = C("e")
d = A("d")

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

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

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

n = A("n")
a = B("a")
e = C("e")
d = A("d")

n.t = e
n.z = e
n.s = d
a.v = e
a.s = d
e.s = n
e.w = n
e.o = a
d.t = e
d.z = e
d.s = n
assert e.o.v.o.txt == "a"