class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: I = None
        self.p: D = None
        self.o: D = None
        self.t: E = None
        self.y: G = None
        self.w: J = None
        self.q: A = None
        self.x: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.z: J = None
        self.y: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: I = None
        self.p: D = None
        self.o: D = None
        self.t: E = None
        self.y: G = None
        self.w: J = None
        self.q: A = None
        self.x: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.z: J = None
        self.y: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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