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

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

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

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

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

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

j.v = k
n.s = k
n.u = k
l.v = k
a.v = k
g.v = n
d.v = k
i.v = n
h.v = n
k.s = n
k.u = n
assert k.u.s.u.s.u.u.txt == "k"