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

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

e = A("e")
h = B("h")
f = A("f")
n = A("n")
i = B("i")
j = B("j")
l = A("l")

e.o = h
h.t = n
h.v = e
f.o = i
n.o = i
i.t = l
i.v = f
j.t = n
j.v = n
l.o = i
assert l.o.v.o.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

e = A("e")
h = B("h")
f = A("f")
n = A("n")
i = B("i")
j = B("j")
l = A("l")

e.o = h
h.t = n
h.v = e
f.o = i
n.o = i
i.t = l
i.v = f
j.t = n
j.v = n
l.o = i
assert l.o.v.o.t.o.t.txt == "l"