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

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

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

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

h.s = e
h.y = e
l.w = h
l.s = h
e.z = l
assert l.w.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

h.s = e
h.y = e
l.w = h
l.s = h
e.z = l
assert l.w.s.z.txt == "l"