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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: J = None
        self.x: E = None
        self.w: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.w: D = None
        self.p: C = None
        self.y: H = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: A = None
        self.x: H = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: J = None
        self.x: E = None
        self.w: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.w: D = None
        self.p: C = None
        self.y: H = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: A = None
        self.x: H = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

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

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