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

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

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

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

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

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

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

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

m = A("m")
d = B("d")
a = C("a")
g = D("g")
k = E("k")
i = F("i")
j = G("j")
h = H("h")

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

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

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

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

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

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

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

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

m = A("m")
d = B("d")
a = C("a")
g = D("g")
k = E("k")
i = F("i")
j = G("j")
h = H("h")

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