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

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

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

h = A("h")
i = B("i")
e = C("e")

h.t = e
h.v = e
i.t = e
i.z = e
i.u = e
e.v = i
assert e.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
e = C("e")

h.t = e
h.v = e
i.t = e
i.z = e
i.u = e
e.v = i
assert e.v.z.v.txt == "i"