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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.v: D = None
        self.o: C = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.v: D = None
        self.o: C = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

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

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