class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: C = None
        self.r: G = None
        self.x: B = None
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: G = None
        self.p: G = None
        self.o: E = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: B = None
        self.w: B = None
        self.z: H = None
        self.q: H = None
        self.v: G = None
        self.r: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.u: F = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: C = None
        self.q: C = None
        self.o: C = None
        self.r: H = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: F = None
        self.p: B = None
        self.t: E = None
        self.q: F = None
        self.o: E = None
        self.w: F = None
        self.r: I = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.v: B = None
        self.t: C = None
        self.p: H = None
        self.w: A = None
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: G = None
        self.p: G = None
        self.o: E = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: B = None
        self.w: B = None
        self.z: H = None
        self.q: H = None
        self.v: G = None
        self.r: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.u: F = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: C = None
        self.q: C = None
        self.o: C = None
        self.r: H = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: F = None
        self.p: B = None
        self.t: E = None
        self.q: F = None
        self.o: E = None
        self.w: F = None
        self.r: I = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.v: B = None
        self.t: C = None
        self.p: H = None
        self.w: A = None
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

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