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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: I = None
        self.o: D = None
        self.z: C = None
        self.y: I = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: E = None
        self.v: E = None
        self.o: F = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: G = None
        self.s: C = None
        self.x: H = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: F = None
        self.x: G = None
        self.w: H = None
        self.o: H = None
        self.z: G = None
        self.y: E = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: I = None
        self.o: D = None
        self.z: C = None
        self.y: I = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: E = None
        self.v: E = None
        self.o: F = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: G = None
        self.s: C = None
        self.x: H = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: F = None
        self.x: G = None
        self.w: H = None
        self.o: H = None
        self.z: G = None
        self.y: E = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

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

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