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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.q: G = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.t: J = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.q: G = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.t: J = None
        self.z: A = None
        self.txt = txt

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

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

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