class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

k = A("k")
d = B("d")
i = C("i")
c = C("c")
j = C("j")
l = A("l")

k.w = l
k.y = l
k.v = l
d.s = l
d.y = k
d.o = c
i.x = d
i.z = l
c.x = d
c.z = l
j.x = d
j.z = l
l.w = k
l.y = k
l.v = k
assert l.y.y.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

k = A("k")
d = B("d")
i = C("i")
c = C("c")
j = C("j")
l = A("l")

k.w = l
k.y = l
k.v = l
d.s = l
d.y = k
d.o = c
i.x = d
i.z = l
c.x = d
c.z = l
j.x = d
j.z = l
l.w = k
l.y = k
l.v = k
assert l.y.y.w.w.txt == "l"