class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: J = None
        self.w: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: A = None
        self.x: D = None
        self.u: D = None
        self.s: J = None
        self.v: H = None
        self.t: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: I = None
        self.w: A = None
        self.v: G = None
        self.q: C = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: J = None
        self.w: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: A = None
        self.x: D = None
        self.u: D = None
        self.s: J = None
        self.v: H = None
        self.t: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: I = None
        self.w: A = None
        self.v: G = None
        self.q: C = None
        self.x: F = None
        self.txt = txt

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

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