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

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

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

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

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

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

e.t = i
i.x = l
i.w = l
f.t = l
l.x = i
l.w = i
k.t = i
assert e.t.w.x.x.w.txt == "i"