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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: F = None
        self.w: C = None
        self.x: H = None
        self.q: J = None
        self.o: B = None
        self.z: J = None
        self.txt = txt

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

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

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

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

k.s = n
k.o = m
k.x = d
k.y = g
k.p = g
k.v = l
k.r = l
k.t = e
k.z = b
h.s = k
h.r = m
l.z = m
e.r = i
e.o = i
e.q = g
e.w = h
e.y = n
e.x = m
e.v = k
e.s = b
d.z = k
d.r = l
g.p = l
g.y = n
i.u = b
i.p = g
i.w = l
i.x = m
i.q = n
i.z = n
i.o = h
m.x = i
m.w = l
m.t = d
m.y = e
b.r = m
b.p = g
n.s = e
n.t = l
assert d.z.y.p.z.y.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: H = None
        self.x: E = None
        self.y: F = None
        self.v: C = None
        self.p: F = None
        self.t: D = None
        self.z: I = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: F = None
        self.w: C = None
        self.x: H = None
        self.q: J = None
        self.o: B = None
        self.z: J = None
        self.txt = txt

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

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

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

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

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