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

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: B = None
        self.u: G = None
        self.y: J = None
        self.x: J = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = None
        self.p: E = None
        self.o: I = None
        self.y: G = None
        self.s: C = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: B = None
        self.u: G = None
        self.y: J = None
        self.x: J = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = None
        self.p: E = None
        self.o: I = None
        self.y: G = None
        self.s: C = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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