import random
a = random.randint(0,999)
count = 0
left= 0
right = 999
middle = int((left+right)/2)#输入的数
print(a)
while a !=middle:
if a>middle:
count=count+1
print(count,middle)
left=middle+1
middle=int((left+right)/2)
else:
count=count+1
print(count,middle)
right=middle-1
middle=int((left+right)/2)
count=count+1
print(count,middle)
a = random.randint(0,999)
count = 0
left= 0
right = 999
middle = int((left+right)/2)#输入的数
print(a)
while a !=middle:
if a>middle:
count=count+1
print(count,middle)
left=middle+1
middle=int((left+right)/2)
else:
count=count+1
print(count,middle)
right=middle-1
middle=int((left+right)/2)
count=count+1
print(count,middle)