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

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

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

e = A("e")
f = B("f")
n = C("n")
b = A("b")

e.v = f
e.z = n
f.t = n
n.v = f
n.u = f
b.v = f
b.z = n
assert e.v.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
n = C("n")
b = A("b")

e.v = f
e.z = n
f.t = n
n.v = f
n.u = f
b.v = f
b.z = n
assert e.v.t.v.txt == "f"