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

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

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

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

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

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

e.o = h
l.q = i
l.t = a
k.o = l
h.q = l
h.t = i
a.q = h
a.t = l
i.q = l
i.t = l
n.o = h
c.o = a
f.o = a
b.o = a
assert a.t.q.t.q.t.q.q.t.t.txt == "l"