class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.x: F = None
        self.u: A = None
        self.o: I = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: F = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.v: F = None
        self.u: B = None
        self.x: H = None
        self.y: B = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: A = None
        self.w: C = None
        self.o: F = None
        self.x: J = None
        self.t: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.x: F = None
        self.u: A = None
        self.o: I = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: F = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.v: F = None
        self.u: B = None
        self.x: H = None
        self.y: B = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: A = None
        self.w: C = None
        self.o: F = None
        self.x: J = None
        self.t: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

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