class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: H = None
        self.v: C = None
        self.u: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: H = None
        self.o: D = None
        self.w: G = None
        self.x: G = None
        self.p: E = None
        self.s: C = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: H = None
        self.o: D = None
        self.w: G = None
        self.x: G = None
        self.p: E = None
        self.s: C = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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