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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: I = None
        self.r: A = None
        self.v: F = None
        self.p: A = None
        self.t: E = None
        self.u: A = None
        self.s: E = None
        self.x: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.x: I = None
        self.u: D = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: E = None
        self.t: H = None
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: I = None
        self.r: A = None
        self.v: F = None
        self.p: A = None
        self.t: E = None
        self.u: A = None
        self.s: E = None
        self.x: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.x: I = None
        self.u: D = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: E = None
        self.t: H = None
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

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