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

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

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

c = A("c")
l = B("l")
e = C("e")
n = B("n")

c.o = e
l.q = n
e.v = c
n.q = l
assert e.v.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
e = C("e")
n = B("n")

c.o = e
l.q = n
e.v = c
n.q = l
assert e.v.o.v.txt == "c"