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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: F = None
        self.q: G = None
        self.x: E = None
        self.s: A = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.w: H = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.s: I = None
        self.t: I = None
        self.y: G = None
        self.w: A = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: G = None
        self.v: E = None
        self.o: D = None
        self.p: H = None
        self.q: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: F = None
        self.q: G = None
        self.x: E = None
        self.s: A = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.w: H = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.s: I = None
        self.t: I = None
        self.y: G = None
        self.w: A = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: G = None
        self.v: E = None
        self.o: D = None
        self.p: H = None
        self.q: H = None
        self.txt = txt

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

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