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.r: B = None
        self.txt = txt

e = A("e")
b = B("b")
l = C("l")
a = A("a")

e.y = l
b.p = l
l.r = b
a.y = l
assert a.y.r.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.r: B = None
        self.txt = txt

e = A("e")
b = B("b")
l = C("l")
a = A("a")

e.y = l
b.p = l
l.r = b
a.y = l
assert a.y.r.p.txt == "l"