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

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

e = A("e")
f = B("f")
l = B("l")
a = A("a")
i = A("i")

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

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

e = A("e")
f = B("f")
l = B("l")
a = A("a")
i = A("i")

e.o = f
f.u = a
l.u = e
a.o = f
i.o = f
assert a.o.u.o.u.o.txt == "f"