class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.q: D = None
        self.x: I = None
        self.s: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: D = None
        self.o: E = None
        self.t: E = None
        self.u: G = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: A = None
        self.o: E = None
        self.u: I = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: E = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: D = None
        self.o: E = None
        self.t: E = None
        self.u: G = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: A = None
        self.o: E = None
        self.u: I = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: E = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: G = None
        self.txt = txt

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

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