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

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

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

d = A("d")
c = B("c")
a = C("a")
l = B("l")
i = A("i")
n = C("n")

d.z = i
d.x = n
d.y = n
c.z = d
a.v = d
a.t = c
l.z = i
i.z = d
i.x = n
i.y = n
n.v = d
n.t = c
assert c.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

d = A("d")
c = B("c")
a = C("a")
l = B("l")
i = A("i")
n = C("n")

d.z = i
d.x = n
d.y = n
c.z = d
a.v = d
a.t = c
l.z = i
i.z = d
i.x = n
i.y = n
n.v = d
n.t = c
assert c.z.z.z.txt == "d"