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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.z: E = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

n = A("n")
l = B("l")
a = C("a")
e = D("e")
m = E("m")
h = E("h")
b = D("b")
d = A("d")
k = E("k")

n.s = a
n.t = l
n.y = h
l.u = a
l.r = k
a.w = n
a.r = l
e.o = b
e.y = b
e.x = d
e.z = k
e.w = a
m.t = l
h.t = l
b.o = e
b.y = e
b.x = d
b.z = h
b.w = a
d.s = a
d.t = l
d.y = m
k.t = l
assert a.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.z: E = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

n = A("n")
l = B("l")
a = C("a")
e = D("e")
m = E("m")
h = E("h")
b = D("b")
d = A("d")
k = E("k")

n.s = a
n.t = l
n.y = h
l.u = a
l.r = k
a.w = n
a.r = l
e.o = b
e.y = b
e.x = d
e.z = k
e.w = a
m.t = l
h.t = l
b.o = e
b.y = e
b.x = d
b.z = h
b.w = a
d.s = a
d.t = l
d.y = m
k.t = l
assert a.w.s.w.txt == "n"