class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: D = None
        self.s: C = None
        self.y: I = None
        self.v: A = None
        self.r: C = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: I = None
        self.v: I = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: D = None
        self.s: C = None
        self.y: I = None
        self.v: A = None
        self.r: C = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: I = None
        self.v: I = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

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

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

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