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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
h = D("h")
j = B("j")
k = C("k")
c = A("c")
l = D("l")

n.w = l
m.s = h
e.w = l
e.x = l
e.z = n
e.y = k
h.u = e
h.y = e
h.o = m
j.s = h
k.w = l
k.x = l
k.z = n
k.y = e
c.w = h
l.u = e
l.o = j
l.y = k
assert l.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
h = D("h")
j = B("j")
k = C("k")
c = A("c")
l = D("l")

n.w = l
m.s = h
e.w = l
e.x = l
e.z = n
e.y = k
h.u = e
h.y = e
h.o = m
j.s = h
k.w = l
k.x = l
k.z = n
k.y = e
c.w = h
l.u = e
l.o = j
l.y = k
assert l.o.s.o.txt == "m"