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

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

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

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

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

h.z = m
h.s = k
d.y = a
d.w = m
a.u = m
i.s = k
i.w = a
e.s = k
e.w = a
m.z = h
m.s = n
b.s = n
b.w = a
n.y = a
n.w = h
k.y = a
k.w = m
assert h.s.y.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

h.z = m
h.s = k
d.y = a
d.w = m
a.u = m
i.s = k
i.w = a
e.s = k
e.w = a
m.z = h
m.s = n
b.s = n
b.w = a
n.y = a
n.w = h
k.y = a
k.w = m
assert h.s.y.u.s.txt == "n"