def binarSearch(list, value):
i = 0
first = 0
last = len(list) - 1;
middle = int((first + last) / 2)
while value != list[middle]:
if value < list[middle]:
last = middle
middle = int((first + last) / 2)
elif value > list[middle]:
first = middle + 1
middle = int((first + last) / 2)
if i == middle - 1 or i >= 5 and len(list) <= 4:
return -1
i += 1
return value
if i == middle - 1 or i >= 5 and len(list) <= 4:
return -1