class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.r: H = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: H = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: H = None
        self.s: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.w: B = None
        self.v: E = None
        self.p: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: H = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: H = None
        self.s: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.w: B = None
        self.v: E = None
        self.p: H = None
        self.z: A = None
        self.txt = txt

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

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