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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: A = None
        self.s: C = None
        self.z: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: I = None
        self.w: B = None
        self.y: J = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: I = None
        self.u: I = None
        self.o: J = None
        self.v: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: C = None
        self.q: E = None
        self.t: B = None
        self.w: E = None
        self.p: H = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: A = None
        self.s: C = None
        self.z: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: I = None
        self.w: B = None
        self.y: J = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: I = None
        self.u: I = None
        self.o: J = None
        self.v: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: C = None
        self.q: E = None
        self.t: B = None
        self.w: E = None
        self.p: H = None
        self.u: E = None
        self.txt = txt

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

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