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

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

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

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

j.o = e
j.r = e
j.t = n
n.r = j
e.s = j
assert j.t.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

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

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

j.o = e
j.r = e
j.t = n
n.r = j
e.s = j
assert j.t.r.t.txt == "n"