class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.q: G = None
        self.o: C = None
        self.u: E = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.z: E = None
        self.y: F = None
        self.s: H = None
        self.w: D = None
        self.q: F = None
        self.t: J = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: J = None
        self.s: E = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: G = None
        self.v: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: H = None
        self.v: B = None
        self.txt = txt

n = A("n")
j = B("j")
c = C("c")
m = D("m")
d = E("d")
l = F("l")
h = G("h")
k = H("k")
b = I("b")
a = J("a")

n.p = d
n.u = d
n.t = m
n.q = h
n.r = h
n.o = c
j.t = k
c.u = h
c.r = n
c.z = d
c.y = l
c.q = l
c.s = k
c.v = k
c.w = m
c.t = a
m.u = c
m.o = a
m.s = d
m.x = d
d.o = n
d.u = h
d.v = c
l.y = j
l.s = m
l.u = n
l.o = n
l.r = n
l.p = c
l.v = c
l.w = d
l.t = h
l.q = b
h.o = b
h.t = m
k.p = b
k.w = m
b.v = l
b.x = h
b.r = j
a.w = j
a.v = j
a.s = k
assert m.u.w.u.t.s.p.r.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.q: G = None
        self.o: C = None
        self.u: E = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.z: E = None
        self.y: F = None
        self.s: H = None
        self.w: D = None
        self.q: F = None
        self.t: J = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: J = None
        self.s: E = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: G = None
        self.v: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: H = None
        self.v: B = None
        self.txt = txt

n = A("n")
j = B("j")
c = C("c")
m = D("m")
d = E("d")
l = F("l")
h = G("h")
k = H("k")
b = I("b")
a = J("a")

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