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

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

b = A("b")
a = B("a")
h = A("h")
j = A("j")
c = A("c")
k = A("k")
l = A("l")
e = B("e")
i = A("i")
m = A("m")

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

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

b = A("b")
a = B("a")
h = A("h")
j = A("j")
c = A("c")
k = A("k")
l = A("l")
e = B("e")
i = A("i")
m = A("m")

b.v = a
b.s = m
a.y = j
a.t = e
h.v = a
h.s = l
j.v = e
j.s = h
c.v = e
c.s = l
k.v = e
k.s = l
l.v = a
l.s = h
e.y = k
e.t = a
i.v = a
i.s = c
m.v = a
m.s = b
assert m.v.y.v.t.t.y.v.t.txt == "a"