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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: C = None
        self.v: I = None
        self.s: I = None
        self.w: H = None
        self.u: F = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: H = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: J = None
        self.z: H = None
        self.w: G = None
        self.x: G = None
        self.u: B = None
        self.s: F = None
        self.r: I = None
        self.q: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.y: E = None
        self.t: B = None
        self.s: A = None
        self.w: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.u: F = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.r: B = None
        self.v: C = None
        self.t: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: C = None
        self.v: I = None
        self.s: I = None
        self.w: H = None
        self.u: F = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: H = None
        self.s: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: J = None
        self.z: H = None
        self.w: G = None
        self.x: G = None
        self.u: B = None
        self.s: F = None
        self.r: I = None
        self.q: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.y: E = None
        self.t: B = None
        self.s: A = None
        self.w: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.u: F = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: A = None
        self.r: B = None
        self.v: C = None
        self.t: H = None
        self.txt = txt

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

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