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

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

f = A("f")
k = B("k")
g = A("g")
i = A("i")
b = A("b")
j = B("j")
n = B("n")

f.v = g
f.s = g
k.o = j
k.u = b
g.v = f
g.s = i
i.v = g
i.s = g
b.v = f
b.s = i
j.o = n
j.u = b
n.o = k
n.u = i
assert n.o.o.o.u.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.txt = txt

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

f = A("f")
k = B("k")
g = A("g")
i = A("i")
b = A("b")
j = B("j")
n = B("n")

f.v = g
f.s = g
k.o = j
k.u = b
g.v = f
g.s = i
i.v = g
i.s = g
b.v = f
b.s = i
j.o = n
j.u = b
n.o = k
n.u = i
assert n.o.o.o.u.v.s.txt == "i"