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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: G = None
        self.s: B = None
        self.v: G = None
        self.q: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: G = None
        self.z: A = None
        self.r: C = None
        self.x: C = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: G = None
        self.s: B = None
        self.v: G = None
        self.q: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: G = None
        self.z: A = None
        self.r: C = None
        self.x: C = None
        self.o: F = None
        self.txt = txt

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

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