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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: G = None
        self.t: F = None
        self.q: F = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.o: E = None
        self.u: H = None
        self.v: A = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: J = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: A = None
        self.r: J = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.x: H = None
        self.r: H = None
        self.o: B = None
        self.w: C = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: H = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: G = None
        self.t: F = None
        self.q: F = None
        self.w: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.o: E = None
        self.u: H = None
        self.v: A = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: J = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: A = None
        self.r: J = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.x: H = None
        self.r: H = None
        self.o: B = None
        self.w: C = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: H = None
        self.v: B = None
        self.txt = txt

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

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