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

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

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: D = None
        self.x: D = None
        self.w: J = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: F = None
        self.v: G = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.q: I = None
        self.r: B = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.r: D = None
        self.y: F = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: H = None
        self.u: H = None
        self.t: G = None
        self.txt = txt

a = A("a")
n = B("n")
c = C("c")
k = D("k")
j = E("j")
e = F("e")
m = G("m")
g = H("g")
h = I("h")
l = J("l")

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

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

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: D = None
        self.x: D = None
        self.w: J = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: F = None
        self.v: G = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.q: I = None
        self.r: B = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.r: D = None
        self.y: F = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: H = None
        self.u: H = None
        self.t: G = None
        self.txt = txt

a = A("a")
n = B("n")
c = C("c")
k = D("k")
j = E("j")
e = F("e")
m = G("m")
g = H("g")
h = I("h")
l = J("l")

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