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

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

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

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

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

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

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

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

j.y = a
f.p = a
a.s = i
i.p = a
l.p = a
assert i.p.s.p.txt == "a"