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

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

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

d = A("d")
l = B("l")
a = C("a")

d.r = l
l.o = a
a.u = l
assert d.r.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

d = A("d")
l = B("l")
a = C("a")

d.r = l
l.o = a
a.u = l
assert d.r.o.u.txt == "l"