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

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

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

b = A("b")
e = B("e")
l = C("l")

b.w = e
e.x = l
e.o = b
l.s = b
l.o = e
assert e.o.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

b = A("b")
e = B("e")
l = C("l")

b.w = e
e.x = l
e.o = b
l.s = b
l.o = e
assert e.o.w.x.txt == "l"