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

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

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

n = A("n")
m = B("m")
e = C("e")

n.t = m
m.y = e
m.z = e
e.v = m
assert e.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
e = C("e")

n.t = m
m.y = e
m.z = e
e.v = m
assert e.v.z.v.txt == "m"