class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: J = None
        self.v: D = None
        self.t: J = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.y: A = None
        self.o: I = None
        self.r: I = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.x: E = None
        self.u: I = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: J = None
        self.v: D = None
        self.t: J = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.y: A = None
        self.o: I = None
        self.r: I = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.x: E = None
        self.u: I = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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