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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.v: B = None
        self.o: H = None
        self.r: G = None
        self.u: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.w: E = None
        self.y: D = None
        self.z: A = None
        self.t: E = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.v: B = None
        self.o: H = None
        self.r: G = None
        self.u: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.w: E = None
        self.y: D = None
        self.z: A = None
        self.t: E = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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