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

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

b = A("b")
l = B("l")
i = A("i")
e = A("e")
a = A("a")
h = B("h")

b.w = i
l.z = e
i.w = b
e.w = a
a.w = b
h.z = i
assert l.z.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

b = A("b")
l = B("l")
i = A("i")
e = A("e")
a = A("a")
h = B("h")

b.w = i
l.z = e
i.w = b
e.w = a
a.w = b
h.z = i
assert l.z.w.w.w.txt == "i"