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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: G = None
        self.o: D = None
        self.t: A = None
        self.s: J = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: H = None
        self.v: F = None
        self.x: C = None
        self.u: C = None
        self.s: C = None
        self.t: J = None
        self.w: C = None
        self.y: G = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: I = None
        self.s: G = None
        self.w: G = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: B = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: I = None
        self.w: A = None
        self.v: H = None
        self.t: B = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: G = None
        self.o: D = None
        self.t: A = None
        self.s: J = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: H = None
        self.v: F = None
        self.x: C = None
        self.u: C = None
        self.s: C = None
        self.t: J = None
        self.w: C = None
        self.y: G = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: I = None
        self.s: G = None
        self.w: G = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: B = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: I = None
        self.w: A = None
        self.v: H = None
        self.t: B = None
        self.o: H = None
        self.txt = txt

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

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