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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.o: A = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: J = None
        self.p: J = None
        self.u: A = None
        self.q: H = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: G = None
        self.s: J = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.o: H = None
        self.y: I = None
        self.z: D = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: C = None
        self.q: G = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.o: A = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: J = None
        self.p: J = None
        self.u: A = None
        self.q: H = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: G = None
        self.s: J = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.o: H = None
        self.y: I = None
        self.z: D = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: C = None
        self.q: G = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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