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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.o: H = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: B = None
        self.t: B = None
        self.p: H = None
        self.x: E = None
        self.s: J = None
        self.v: I = None
        self.w: D = None
        self.r: J = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: H = None
        self.v: H = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.o: H = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: B = None
        self.t: B = None
        self.p: H = None
        self.x: E = None
        self.s: J = None
        self.v: I = None
        self.w: D = None
        self.r: J = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: H = None
        self.v: H = None
        self.t: F = None
        self.txt = txt

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

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