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

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

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

k.w = d
k.v = n
d.r = n
d.u = g
b.r = g
b.u = n
h.w = d
h.v = b
g.r = b
g.u = j
j.r = d
j.u = a
n.r = g
n.u = a
l.w = g
l.v = g
a.r = b
a.u = d
assert b.u.r.r.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

k.w = d
k.v = n
d.r = n
d.u = g
b.r = g
b.u = n
h.w = d
h.v = b
g.r = b
g.u = j
j.r = d
j.u = a
n.r = g
n.u = a
l.w = g
l.v = g
a.r = b
a.u = d
assert b.u.r.r.u.u.txt == "a"