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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: A = None
        self.q: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: A = None
        self.t: B = None
        self.q: G = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: G = None
        self.x: I = None
        self.q: H = None
        self.w: I = None
        self.r: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: E = None
        self.y: J = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: A = None
        self.q: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: A = None
        self.t: B = None
        self.q: G = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: G = None
        self.x: I = None
        self.q: H = None
        self.w: I = None
        self.r: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: E = None
        self.y: J = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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