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

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

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

b = A("b")
g = B("g")
i = C("i")
l = B("l")

b.u = i
g.y = l
g.t = i
i.v = g
l.y = g
l.t = i
assert i.v.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

b = A("b")
g = B("g")
i = C("i")
l = B("l")

b.u = i
g.y = l
g.t = i
i.v = g
l.y = g
l.t = i
assert i.v.y.t.txt == "i"