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

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

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

e.o = l
i.u = l
i.w = h
h.o = l
l.u = i
l.w = h
assert i.w.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

e.o = l
i.u = l
i.w = h
h.o = l
l.u = i
l.w = h
assert i.w.o.u.txt == "i"