class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: B = None
        self.u: J = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: F = None
        self.x: H = None
        self.p: J = None
        self.v: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: F = None
        self.q: J = None
        self.z: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: A = None
        self.z: C = None
        self.s: G = None
        self.v: I = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

a = A("a")
l = B("l")
n = C("n")
g = D("g")
b = E("b")
i = F("i")
k = G("k")
h = H("h")
m = I("m")
d = J("d")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: F = None
        self.x: H = None
        self.p: J = None
        self.v: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: F = None
        self.q: J = None
        self.z: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: A = None
        self.z: C = None
        self.s: G = None
        self.v: I = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

a = A("a")
l = B("l")
n = C("n")
g = D("g")
b = E("b")
i = F("i")
k = G("k")
h = H("h")
m = I("m")
d = J("d")

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