class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: D = None
        self.v: F = None
        self.s: F = None
        self.t: D = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: J = None
        self.p: E = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: G = None
        self.z: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: J = None
        self.p: E = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: G = None
        self.z: I = None
        self.txt = txt

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

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