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

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

e = A("e")
a = B("a")
f = A("f")
l = B("l")
n = B("n")
g = B("g")
b = A("b")
j = A("j")
k = A("k")
h = B("h")

e.s = g
e.u = g
a.t = k
f.s = a
f.u = h
l.t = b
n.t = b
g.t = b
b.s = n
b.u = g
j.s = g
j.u = g
k.s = n
k.u = l
h.t = f
assert f.s.t.s.t.u.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

e = A("e")
a = B("a")
f = A("f")
l = B("l")
n = B("n")
g = B("g")
b = A("b")
j = A("j")
k = A("k")
h = B("h")

e.s = g
e.u = g
a.t = k
f.s = a
f.u = h
l.t = b
n.t = b
g.t = b
b.s = n
b.u = g
j.s = g
j.u = g
k.s = n
k.u = l
h.t = f
assert f.s.t.s.t.u.t.s.t.txt == "b"