class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: B = None
        self.u: C = None
        self.p: I = None
        self.x: B = None
        self.q: B = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: C = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

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

n.z = c
n.s = c
n.y = b
n.x = b
n.q = b
n.u = i
n.p = j
b.y = a
b.q = k
b.t = d
b.s = d
b.r = j
b.w = i
b.o = i
b.u = f
b.v = c
b.x = n
i.p = n
i.q = b
i.u = a
k.v = a
k.o = i
f.u = k
f.t = i
d.z = m
d.q = f
d.v = b
d.y = b
d.x = a
d.r = n
a.r = f
a.p = i
a.x = k
c.z = a
c.t = b
c.s = b
j.q = d
j.t = d
j.v = m
j.u = m
j.x = m
j.s = f
j.y = k
j.r = i
j.p = c
m.v = a
m.s = a
m.p = f
m.q = i
m.y = c
assert a.r.t.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: B = None
        self.u: C = None
        self.p: I = None
        self.x: B = None
        self.q: B = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: C = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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