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

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

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

b = A("b")
l = B("l")
n = C("n")
d = B("d")
e = B("e")

b.v = e
l.y = n
n.p = l
n.s = l
n.z = e
d.y = n
e.y = n
assert d.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
n = C("n")
d = B("d")
e = B("e")

b.v = e
l.y = n
n.p = l
n.s = l
n.z = e
d.y = n
e.y = n
assert d.y.z.y.txt == "n"