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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: C = None
        self.z: A = None
        self.q: J = None
        self.w: H = None
        self.o: C = None
        self.u: H = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: C = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

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

g = A("g")
a = B("a")
c = C("c")
k = D("k")
l = E("l")
i = F("i")
e = G("e")
f = H("f")
m = I("m")
n = J("n")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: C = None
        self.z: A = None
        self.q: J = None
        self.w: H = None
        self.o: C = None
        self.u: H = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: C = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

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

g = A("g")
a = B("a")
c = C("c")
k = D("k")
l = E("l")
i = F("i")
e = G("e")
f = H("f")
m = I("m")
n = J("n")

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