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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.y: J = None
        self.q: I = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: J = None
        self.t: C = None
        self.o: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: G = None
        self.r: C = None
        self.z: F = None
        self.u: C = None
        self.o: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: D = None
        self.u: A = None
        self.p: A = None
        self.v: D = None
        self.q: E = None
        self.z: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.y: J = None
        self.q: I = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: J = None
        self.t: C = None
        self.o: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: G = None
        self.r: C = None
        self.z: F = None
        self.u: C = None
        self.o: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: D = None
        self.u: A = None
        self.p: A = None
        self.v: D = None
        self.q: E = None
        self.z: G = None
        self.txt = txt

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

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

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