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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.v: G = None
        self.x: B = None
        self.q: B = None
        self.s: D = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.x: B = None
        self.y: H = None
        self.r: F = None
        self.u: D = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: A = None
        self.p: G = None
        self.q: E = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.v: G = None
        self.x: B = None
        self.q: B = None
        self.s: D = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.x: B = None
        self.y: H = None
        self.r: F = None
        self.u: D = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: A = None
        self.p: G = None
        self.q: E = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

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