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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: G = None
        self.z: A = None
        self.y: C = None
        self.r: F = None
        self.o: H = None
        self.p: C = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: H = None
        self.u: H = None
        self.z: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: G = None
        self.z: A = None
        self.y: C = None
        self.r: F = None
        self.o: H = None
        self.p: C = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: H = None
        self.u: H = None
        self.z: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: D = None
        self.txt = txt

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

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