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

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

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

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

g.v = j
g.s = j
c.y = g
j.t = e
j.y = e
e.t = j
e.y = j
assert e.y.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.txt = txt

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

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

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

g.v = j
g.s = j
c.y = g
j.t = e
j.y = e
e.t = j
e.y = j
assert e.y.t.y.txt == "j"