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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: H = None
        self.r: I = None
        self.t: F = None
        self.y: I = None
        self.s: E = None
        self.o: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: E = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: F = None
        self.z: B = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: J = None
        self.u: I = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.t: I = None
        self.x: I = None
        self.y: E = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.t: B = None
        self.v: H = None
        self.y: B = None
        self.o: F = None
        self.z: H = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: H = None
        self.r: I = None
        self.t: F = None
        self.y: I = None
        self.s: E = None
        self.o: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: E = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: F = None
        self.z: B = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: J = None
        self.u: I = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.t: I = None
        self.x: I = None
        self.y: E = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.t: B = None
        self.v: H = None
        self.y: B = None
        self.o: F = None
        self.z: H = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

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

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