class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

d.x = f
d.s = f
d.u = a
k.w = m
k.y = m
k.t = f
k.z = n
m.s = f
f.w = a
f.o = a
a.q = m
n.w = m
n.y = m
n.t = f
n.z = k
assert d.x.w.q.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

d.x = f
d.s = f
d.u = a
k.w = m
k.y = m
k.t = f
k.z = n
m.s = f
f.w = a
f.o = a
a.q = m
n.w = m
n.y = m
n.t = f
n.z = k
assert d.x.w.q.s.o.txt == "a"