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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: B = None
        self.o: I = None
        self.q: I = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: D = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.v: B = None
        self.z: D = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: B = None
        self.o: I = None
        self.q: I = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: D = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.v: B = None
        self.z: D = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

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

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