class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: J = None
        self.q: F = None
        self.z: D = None
        self.p: J = None
        self.x: J = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: J = None
        self.o: J = None
        self.v: H = None
        self.t: B = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.t: H = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: F = None
        self.r: C = None
        self.s: F = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: H = None
        self.x: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: J = None
        self.o: J = None
        self.v: H = None
        self.t: B = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.t: H = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: F = None
        self.r: C = None
        self.s: F = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: H = None
        self.x: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

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