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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: H = None
        self.s: I = None
        self.t: B = None
        self.u: F = None
        self.p: E = None
        self.w: F = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: D = None
        self.y: J = None
        self.o: F = None
        self.p: F = None
        self.z: B = None
        self.v: G = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: J = None
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: G = None
        self.y: C = None
        self.q: H = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: H = None
        self.s: I = None
        self.t: B = None
        self.u: F = None
        self.p: E = None
        self.w: F = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: D = None
        self.y: J = None
        self.o: F = None
        self.p: F = None
        self.z: B = None
        self.v: G = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: J = None
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: G = None
        self.y: C = None
        self.q: H = None
        self.p: C = None
        self.txt = txt

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

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