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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: J = None
        self.x: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.r: J = None
        self.p: A = None
        self.q: A = None
        self.w: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: J = None
        self.x: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.r: J = None
        self.p: A = None
        self.q: A = None
        self.w: D = None
        self.x: B = None
        self.txt = txt

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

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

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