class A:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: I = None
        self.txt = txt

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

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

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

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