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

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

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

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

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

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

e.u = f
f.y = l
i.u = f
l.u = f
k.u = f
assert k.u.y.u.txt == "f"