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

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

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

b.o = e
e.y = l
d.o = e
l.y = e
assert e.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

b.o = e
e.y = l
d.o = e
l.y = e
assert e.y.y.y.y.txt == "e"