class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: F = None
        self.p: I = None
        self.u: C = None
        self.q: J = None
        self.t: D = None
        self.o: I = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: J = None
        self.z: H = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: F = None
        self.p: I = None
        self.u: C = None
        self.q: J = None
        self.t: D = None
        self.o: I = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: J = None
        self.z: H = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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