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

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

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

f = A("f")
l = B("l")
j = C("j")

f.v = j
f.w = j
l.w = f
l.u = j
j.w = f
j.u = l
j.y = l
assert f.w.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.txt = txt

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

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

f = A("f")
l = B("l")
j = C("j")

f.v = j
f.w = j
l.w = f
l.u = j
j.w = f
j.u = l
j.y = l
assert f.w.u.u.txt == "j"