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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: J = None
        self.z: I = None
        self.w: D = None
        self.q: C = None
        self.t: H = None
        self.x: H = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.w: D = None
        self.s: A = None
        self.x: F = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: J = None
        self.x: C = None
        self.o: H = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.o: G = None
        self.r: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: J = None
        self.z: I = None
        self.w: D = None
        self.q: C = None
        self.t: H = None
        self.x: H = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.w: D = None
        self.s: A = None
        self.x: F = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: J = None
        self.x: C = None
        self.o: H = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.o: G = None
        self.r: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

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

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