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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: A = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

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

d = A("d")
a = B("a")
e = C("e")
n = D("n")
m = C("m")
l = A("l")
k = D("k")
f = A("f")

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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: A = None
        self.x: A = None
        self.q: A = None
        self.txt = txt

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

d = A("d")
a = B("a")
e = C("e")
n = D("n")
m = C("m")
l = A("l")
k = D("k")
f = A("f")

d.w = a
d.z = a
d.v = a
d.u = e
a.y = l
a.r = e
a.s = e
a.x = f
e.z = m
e.o = l
e.q = l
e.x = d
n.y = e
m.z = e
m.o = d
m.x = l
m.q = l
l.w = a
l.z = a
l.v = a
l.u = m
k.y = e
f.w = a
f.z = a
f.v = a
f.u = e
assert m.o.u.x.v.y.w.s.txt == "e"