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

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

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

n.t = d
l.v = d
d.v = l
b.t = d
e.t = d
c.t = d
assert d.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

n.t = d
l.v = d
d.v = l
b.t = d
e.t = d
c.t = d
assert d.v.v.v.txt == "l"