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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.q: I = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: F = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: I = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: A = None
        self.s: F = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.q: I = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: F = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: I = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: A = None
        self.s: F = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: C = None
        self.txt = txt

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

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