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

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

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

j = A("j")
l = B("l")
c = C("c")
g = A("g")

j.t = l
j.o = l
l.y = c
l.v = c
c.y = l
g.t = l
g.o = l
assert c.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

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

j = A("j")
l = B("l")
c = C("c")
g = A("g")

j.t = l
j.o = l
l.y = c
l.v = c
c.y = l
g.t = l
g.o = l
assert c.y.v.y.txt == "l"