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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: H = None
        self.o: I = None
        self.w: I = None
        self.s: F = None
        self.q: E = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: J = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: D = None
        self.q: C = None
        self.x: E = None
        self.r: J = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: H = None
        self.o: I = None
        self.w: I = None
        self.s: F = None
        self.q: E = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: J = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: D = None
        self.q: C = None
        self.x: E = None
        self.r: J = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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