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

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

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

h = A("h")
a = B("a")
l = C("l")
k = C("k")
i = B("i")

h.s = i
h.x = i
h.w = k
a.t = i
a.y = i
a.s = l
l.s = k
l.q = k
l.y = k
k.s = l
k.q = l
k.y = l
i.t = a
i.y = a
i.s = l
assert i.y.t.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.w: C = None
        self.txt = txt

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

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

h = A("h")
a = B("a")
l = C("l")
k = C("k")
i = B("i")

h.s = i
h.x = i
h.w = k
a.t = i
a.y = i
a.s = l
l.s = k
l.q = k
l.y = k
k.s = l
k.q = l
k.y = l
i.t = a
i.y = a
i.s = l
assert i.y.t.s.q.txt == "k"