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

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

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

k = A("k")
e = B("e")
j = C("j")

k.v = e
k.x = e
k.t = e
e.r = k
e.q = k
j.z = k
assert j.z.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.t: B = None
        self.txt = txt

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

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

k = A("k")
e = B("e")
j = C("j")

k.v = e
k.x = e
k.t = e
e.r = k
e.q = k
j.z = k
assert j.z.t.r.txt == "k"