def locate(A,s,n,x):
     if n==1:
         if A[s]==x: return s 
         else: return -1
     m = n/2;
     j = locate(A,s,m,x);
     k = locate(A,s+m,n-m,x);
     if k>=0: return k
     else: return j

A = [1,2,3,4,5,6,7,8,9,10,11,12,13,14]
k = locate(A,0,14,6)
print(k)

