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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: F = None
        self.z: J = None
        self.w: H = None
        self.t: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: I = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.v: A = None
        self.q: C = None
        self.y: H = None
        self.o: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: C = None
        self.t: E = None
        self.r: D = None
        self.s: A = None
        self.txt = txt

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

a = A("a")
e = B("e")
b = C("b")
d = D("d")
c = E("c")
l = F("l")
f = G("f")
j = H("j")
k = I("k")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: F = None
        self.z: J = None
        self.w: H = None
        self.t: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: I = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.v: A = None
        self.q: C = None
        self.y: H = None
        self.o: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: C = None
        self.t: E = None
        self.r: D = None
        self.s: A = None
        self.txt = txt

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

a = A("a")
e = B("e")
b = C("b")
d = D("d")
c = E("c")
l = F("l")
f = G("f")
j = H("j")
k = I("k")
m = J("m")

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