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

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: E = None
        self.x: D = None
        self.w: F = None
        self.o: A = None
        self.y: F = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: H = None
        self.o: H = None
        self.r: D = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: C = None
        self.o: I = None
        self.q: A = None
        self.s: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: E = None
        self.x: D = None
        self.w: F = None
        self.o: A = None
        self.y: F = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: H = None
        self.o: H = None
        self.r: D = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: C = None
        self.o: I = None
        self.q: A = None
        self.s: A = None
        self.txt = txt

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

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