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

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

j = A("j")
i = B("i")
n = A("n")
l = B("l")
f = A("f")
e = B("e")
k = B("k")
m = B("m")
g = A("g")

j.s = l
j.v = k
i.w = k
i.t = f
n.s = i
n.v = e
l.w = e
l.t = f
f.s = i
f.v = l
e.w = i
e.t = g
k.w = i
k.t = g
m.w = e
m.t = j
g.s = l
g.v = k
assert f.s.w.t.s.w.t.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

j = A("j")
i = B("i")
n = A("n")
l = B("l")
f = A("f")
e = B("e")
k = B("k")
m = B("m")
g = A("g")

j.s = l
j.v = k
i.w = k
i.t = f
n.s = i
n.v = e
l.w = e
l.t = f
f.s = i
f.v = l
e.w = i
e.t = g
k.w = i
k.t = g
m.w = e
m.t = j
g.s = l
g.v = k
assert f.s.w.t.s.w.t.s.w.txt == "e"