class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: G = None
        self.v: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.y: B = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.t: F = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.p: D = None
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.y: B = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.t: F = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.p: D = None
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

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