class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.z: B = None
        self.v: F = None
        self.p: B = None
        self.u: J = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.v: J = None
        self.x: F = None
        self.w: J = None
        self.z: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.v: J = None
        self.x: F = None
        self.w: J = None
        self.z: D = None
        self.txt = txt

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

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

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