class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: D = None
        self.z: J = None
        self.t: C = None
        self.p: A = None
        self.q: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: I = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: J = None
        self.z: D = None
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.w: G = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: D = None
        self.z: J = None
        self.t: C = None
        self.p: A = None
        self.q: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: I = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: J = None
        self.z: D = None
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.w: G = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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

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