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

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

c = A("c")
a = B("a")
e = B("e")
i = A("i")
n = A("n")
l = B("l")
d = A("d")
f = A("f")
b = B("b")

c.t = b
a.o = l
e.o = b
i.t = b
n.t = l
l.o = e
d.t = l
f.t = a
b.o = l
assert c.t.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

c = A("c")
a = B("a")
e = B("e")
i = A("i")
n = A("n")
l = B("l")
d = A("d")
f = A("f")
b = B("b")

c.t = b
a.o = l
e.o = b
i.t = b
n.t = l
l.o = e
d.t = l
f.t = a
b.o = l
assert c.t.o.o.txt == "e"