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

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

class C:
    def __init__(self, txt: str):
        self.y: J = None
        self.q: B = None
        self.w: D = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.x: C = None
        self.y: I = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.q: J = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.v: A = None
        self.u: E = None
        self.q: D = None
        self.txt = txt

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

n = A("n")
e = B("e")
l = C("l")
a = D("a")
m = E("m")
c = F("c")
h = G("h")
j = H("j")
b = I("b")
d = J("d")

n.p = j
n.t = d
n.u = h
n.x = l
n.o = c
n.r = b
n.y = m
e.q = n
e.o = n
e.p = n
e.t = j
e.r = h
e.x = h
e.s = h
e.v = m
e.y = d
e.w = l
l.y = d
l.q = e
l.w = a
l.p = h
l.t = b
a.w = b
m.u = b
m.y = b
m.w = l
m.x = l
m.v = l
c.u = l
c.s = e
c.q = d
c.w = d
c.o = b
h.r = b
j.y = b
j.v = a
j.x = h
b.r = c
b.t = a
b.q = a
b.v = n
b.u = m
d.p = n
d.v = n
d.y = n
d.s = n
d.x = h
d.t = h
d.r = h
d.u = h
d.z = a
d.o = b
assert h.r.r.q.s.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: J = None
        self.u: G = None
        self.x: C = None
        self.o: F = None
        self.r: I = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: J = None
        self.q: B = None
        self.w: D = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.x: C = None
        self.y: I = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.q: J = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.v: A = None
        self.u: E = None
        self.q: D = None
        self.txt = txt

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

n = A("n")
e = B("e")
l = C("l")
a = D("a")
m = E("m")
c = F("c")
h = G("h")
j = H("j")
b = I("b")
d = J("d")

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