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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.v: A = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: F = None
        self.u: B = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: I = None
        self.y: C = None
        self.t: H = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: D = None
        self.t: B = None
        self.w: A = None
        self.p: D = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.o: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.v: A = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: F = None
        self.u: B = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: I = None
        self.y: C = None
        self.t: H = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: D = None
        self.t: B = None
        self.w: A = None
        self.p: D = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.o: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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