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

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.txt = txt

n = A("n")
i = B("i")
e = C("e")
k = C("k")
m = C("m")
l = B("l")
f = C("f")
b = C("b")
j = C("j")
c = B("c")

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

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.txt = txt

n = A("n")
i = B("i")
e = C("e")
k = C("k")
m = C("m")
l = B("l")
f = C("f")
b = C("b")
j = C("j")
c = B("c")

n.s = c
i.y = n
i.v = l
e.r = k
e.w = j
k.r = e
k.w = j
m.r = e
m.w = j
l.y = n
l.v = i
f.r = e
f.w = m
b.r = m
b.w = e
j.r = e
j.w = e
c.y = n
c.v = l
assert k.r.r.r.w.r.w.txt == "j"