class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.y: E = None
        self.r: D = None
        self.t: H = None
        self.s: J = None
        self.w: H = None
        self.u: H = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.t: G = None
        self.s: E = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: D = None
        self.u: A = None
        self.q: E = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.y: E = None
        self.r: D = None
        self.t: H = None
        self.s: J = None
        self.w: H = None
        self.u: H = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.t: G = None
        self.s: E = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: D = None
        self.u: A = None
        self.q: E = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: F = None
        self.txt = txt

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

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

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