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

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

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

f = A("f")
g = B("g")
i = C("i")
a = C("a")

f.v = g
g.t = f
g.v = i
g.y = a
i.u = a
a.u = i
assert i.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
i = C("i")
a = C("a")

f.v = g
g.t = f
g.v = i
g.y = a
i.u = a
a.u = i
assert i.u.u.u.u.txt == "i"