class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: C = None
        self.v: I = None
        self.p: E = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.v: G = None
        self.o: D = None
        self.z: I = None
        self.w: F = None
        self.y: F = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: C = None
        self.v: I = None
        self.p: E = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: D = None
        self.v: G = None
        self.o: D = None
        self.z: I = None
        self.w: F = None
        self.y: F = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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