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

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

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

e = A("e")
i = B("i")
k = C("k")
a = C("a")

e.u = k
i.t = e
i.s = a
k.w = a
a.w = k
assert i.s.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
k = C("k")
a = C("a")

e.u = k
i.t = e
i.s = a
k.w = a
a.w = k
assert i.s.w.w.txt == "a"