class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: I = None
        self.y: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.x: D = None
        self.v: D = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: J = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: I = None
        self.r: J = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: H = None
        self.q: F = None
        self.w: G = None
        self.u: H = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.x: D = None
        self.v: D = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: J = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: I = None
        self.r: J = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: H = None
        self.q: F = None
        self.w: G = None
        self.u: H = None
        self.t: F = None
        self.txt = txt

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

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