class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: I = None
        self.r: H = None
        self.v: D = None
        self.s: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: C = None
        self.z: H = None
        self.t: I = None
        self.r: C = None
        self.p: H = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: C = None
        self.v: B = None
        self.x: E = None
        self.q: B = None
        self.p: H = None
        self.s: H = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.u: A = None
        self.t: A = None
        self.r: B = None
        self.z: C = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: G = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: I = None
        self.t: D = None
        self.u: H = None
        self.s: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: C = None
        self.z: H = None
        self.t: I = None
        self.r: C = None
        self.p: H = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: C = None
        self.v: B = None
        self.x: E = None
        self.q: B = None
        self.p: H = None
        self.s: H = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.u: A = None
        self.t: A = None
        self.r: B = None
        self.z: C = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: G = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: I = None
        self.t: D = None
        self.u: H = None
        self.s: I = None
        self.txt = txt

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

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