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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.v: E = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

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

m = A("m")
j = B("j")
n = C("n")
d = D("d")
a = E("a")
c = A("c")
l = B("l")
h = B("h")
f = B("f")

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.v: E = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

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

m = A("m")
j = B("j")
n = C("n")
d = D("d")
a = E("a")
c = A("c")
l = B("l")
h = B("h")
f = B("f")

m.w = a
m.u = l
m.y = h
m.q = n
m.r = j
j.s = d
j.p = d
j.x = n
j.t = n
j.v = a
n.p = a
n.o = d
n.x = d
d.y = n
d.w = n
d.z = m
d.v = m
a.z = m
c.w = a
c.u = l
c.y = f
c.r = f
c.q = n
l.s = d
l.p = d
l.x = n
l.t = n
l.v = a
h.s = d
h.p = d
h.x = n
h.t = n
h.v = a
f.s = d
f.p = d
f.x = n
f.t = n
f.v = a
assert f.s.y.x.w.o.v.w.z.w.txt == "a"