class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.w: H = None
        self.t: D = None
        self.x: D = None
        self.p: G = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: E = None
        self.s: B = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.w: J = None
        self.t: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: I = None
        self.w: H = None
        self.t: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: E = None
        self.s: B = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.w: J = None
        self.t: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: I = None
        self.w: H = None
        self.t: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

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

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