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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.r: I = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: E = None
        self.z: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: J = None
        self.v: E = None
        self.x: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: F = None
        self.x: J = None
        self.r: G = None
        self.s: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: I = None
        self.s: F = None
        self.z: G = None
        self.r: I = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.r: I = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: E = None
        self.z: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: J = None
        self.v: E = None
        self.x: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: F = None
        self.x: J = None
        self.r: G = None
        self.s: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: I = None
        self.s: F = None
        self.z: G = None
        self.r: I = None
        self.w: B = None
        self.txt = txt

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

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