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

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

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

n = A("n")
e = B("e")
k = C("k")
l = B("l")
i = B("i")
a = B("a")
d = A("d")
j = C("j")

n.r = e
n.u = d
n.v = d
e.t = d
e.s = k
k.o = d
k.w = a
l.t = n
l.s = j
i.t = d
i.s = k
a.t = d
a.s = j
d.r = i
d.u = n
d.v = n
j.o = n
j.w = i
assert l.t.r.t.u.r.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.v: A = None
        self.txt = txt

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

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

n = A("n")
e = B("e")
k = C("k")
l = B("l")
i = B("i")
a = B("a")
d = A("d")
j = C("j")

n.r = e
n.u = d
n.v = d
e.t = d
e.s = k
k.o = d
k.w = a
l.t = n
l.s = j
i.t = d
i.s = k
a.t = d
a.s = j
d.r = i
d.u = n
d.v = n
j.o = n
j.w = i
assert l.t.r.t.u.r.s.w.txt == "a"