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

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

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

f = A("f")
j = B("j")
l = C("l")
i = B("i")

f.s = i
j.w = i
l.p = i
i.w = j
assert j.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
l = C("l")
i = B("i")

f.s = i
j.w = i
l.p = i
i.w = j
assert j.w.w.w.txt == "i"