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

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

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

e = A("e")
l = B("l")
k = C("k")
f = A("f")

e.t = k
e.z = f
e.o = l
l.w = k
k.x = l
k.o = l
f.t = k
f.z = e
f.o = l
assert e.o.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.o: B = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
k = C("k")
f = A("f")

e.t = k
e.z = f
e.o = l
l.w = k
k.x = l
k.o = l
f.t = k
f.z = e
f.o = l
assert e.o.w.x.txt == "l"