class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: H = None
        self.z: B = None
        self.p: D = None
        self.v: E = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: H = None
        self.y: F = None
        self.q: F = None
        self.t: B = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: B = None
        self.w: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: B = None
        self.s: B = None
        self.q: C = None
        self.t: D = None
        self.p: E = None
        self.z: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.w: B = None
        self.z: C = None
        self.q: G = None
        self.u: D = None
        self.txt = txt

m = A("m")
a = B("a")
h = C("h")
l = D("l")
b = E("b")
f = F("f")
e = G("e")
n = H("n")
k = D("k")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: H = None
        self.y: F = None
        self.q: F = None
        self.t: B = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: B = None
        self.w: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: B = None
        self.s: B = None
        self.q: C = None
        self.t: D = None
        self.p: E = None
        self.z: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.w: B = None
        self.z: C = None
        self.q: G = None
        self.u: D = None
        self.txt = txt

m = A("m")
a = B("a")
h = C("h")
l = D("l")
b = E("b")
f = F("f")
e = G("e")
n = H("n")
k = D("k")
d = H("d")

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