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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.t: B = None
        self.w: H = None
        self.s: A = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: H = None
        self.r: J = None
        self.v: G = None
        self.y: A = None
        self.s: I = None
        self.q: D = None
        self.t: H = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.y: B = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: I = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.u: G = None
        self.x: F = None
        self.q: F = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: C = None
        self.u: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.t: B = None
        self.w: H = None
        self.s: A = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: H = None
        self.r: J = None
        self.v: G = None
        self.y: A = None
        self.s: I = None
        self.q: D = None
        self.t: H = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: D = None
        self.y: B = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: I = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.u: G = None
        self.x: F = None
        self.q: F = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: C = None
        self.u: C = None
        self.v: A = None
        self.txt = txt

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

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