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

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

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

n = A("n")
b = B("b")
a = C("a")
l = C("l")
h = A("h")
k = B("k")
c = A("c")
i = B("i")
g = B("g")
d = B("d")

n.u = l
n.w = a
b.w = n
b.z = i
a.u = i
a.r = l
a.t = l
l.u = k
l.r = a
l.t = a
h.u = a
h.w = l
k.w = n
k.z = g
c.u = l
c.w = l
i.w = h
i.z = d
g.w = h
g.z = b
d.w = h
d.z = b
assert d.w.w.r.u.w.w.t.t.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

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

n = A("n")
b = B("b")
a = C("a")
l = C("l")
h = A("h")
k = B("k")
c = A("c")
i = B("i")
g = B("g")
d = B("d")

n.u = l
n.w = a
b.w = n
b.z = i
a.u = i
a.r = l
a.t = l
l.u = k
l.r = a
l.t = a
h.u = a
h.w = l
k.w = n
k.z = g
c.u = l
c.w = l
i.w = h
i.z = d
g.w = h
g.z = b
d.w = h
d.z = b
assert d.w.w.r.u.w.w.t.t.u.w.txt == "n"