class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.p: B = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.s: C = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.v: B = None
        self.w: D = None
        self.txt = txt

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

a = A("a")
h = B("h")
d = C("d")
i = D("i")
n = E("n")
g = A("g")
m = B("m")
k = D("k")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.s: C = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.v: B = None
        self.w: D = None
        self.txt = txt

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

a = A("a")
h = B("h")
d = C("d")
i = D("i")
n = E("n")
g = A("g")
m = B("m")
k = D("k")

a.y = n
a.w = g
a.p = m
a.o = m
a.s = k
h.v = a
h.y = a
h.u = d
h.s = d
h.t = m
d.o = n
d.x = k
d.z = g
d.q = h
i.r = h
i.y = m
i.v = m
i.w = k
n.z = d
g.y = n
g.w = a
g.p = h
g.o = h
g.s = k
m.v = a
m.y = a
m.u = d
m.s = d
m.t = h
k.r = h
k.y = m
k.v = m
k.w = i
assert h.v.w.w.w.y.z.txt == "d"