class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: J = None
        self.s: D = None
        self.x: F = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: D = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: A = None
        self.u: G = None
        self.p: G = None
        self.o: I = None
        self.v: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.v: F = None
        self.s: I = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: D = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: A = None
        self.u: G = None
        self.p: G = None
        self.o: I = None
        self.v: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.v: F = None
        self.s: I = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

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