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

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

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

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

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

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

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