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

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

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

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

i.w = d
i.z = d
i.v = d
c.v = b
k.t = c
l.t = b
b.v = c
d.w = i
d.z = i
d.v = i
assert b.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

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

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

i.w = d
i.z = d
i.v = d
c.v = b
k.t = c
l.t = b
b.v = c
d.w = i
d.z = i
d.v = i
assert b.v.v.v.txt == "c"