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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: F = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: F = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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