class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.z: A = None
        self.p: J = None
        self.s: B = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: B = None
        self.q: F = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.z: A = None
        self.p: J = None
        self.s: B = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: B = None
        self.q: F = None
        self.x: F = None
        self.txt = txt

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

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