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

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

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

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

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

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

e.z = j
e.s = a
i.v = j
i.t = l
h.z = l
h.s = a
b.z = l
b.s = h
j.v = l
j.t = n
a.z = n
a.s = e
n.v = i
n.t = i
l.v = j
l.t = j
assert j.v.v.t.txt == "n"