class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.q: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: D = None
        self.r: E = None
        self.v: H = None
        self.z: F = None
        self.q: J = None
        self.w: H = None
        self.p: C = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: J = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: H = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: I = None
        self.o: C = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: D = None
        self.r: E = None
        self.v: H = None
        self.z: F = None
        self.q: J = None
        self.w: H = None
        self.p: C = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: J = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: H = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: I = None
        self.o: C = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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