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

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

n = A("n")
e = B("e")
b = A("b")
j = B("j")
m = B("m")
a = A("a")
g = A("g")
k = A("k")
i = B("i")
h = A("h")

n.u = m
n.x = j
e.u = h
e.v = j
b.u = i
b.x = j
j.u = n
j.v = e
m.u = n
m.v = e
a.u = m
a.x = e
g.u = m
g.x = i
k.u = e
k.x = j
i.u = h
i.v = m
h.u = i
h.x = m
assert j.v.u.u.v.v.v.v.v.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

n = A("n")
e = B("e")
b = A("b")
j = B("j")
m = B("m")
a = A("a")
g = A("g")
k = A("k")
i = B("i")
h = A("h")

n.u = m
n.x = j
e.u = h
e.v = j
b.u = i
b.x = j
j.u = n
j.v = e
m.u = n
m.v = e
a.u = m
a.x = e
g.u = m
g.x = i
k.u = e
k.x = j
i.u = h
i.v = m
h.u = i
h.x = m
assert j.v.u.u.v.v.v.v.v.u.x.txt == "j"