print("I am going to read your mind!")
print("Choose a random number, and tell me the range")
input_a = input("What is the lowest number in the range?")
input_b = input("What is the highest number in the range?")
low_bound = min(input_a,input_b)
up_bound = max(input_a,input_b)
won = False
guess = low_bound + (up_bound - low_bound) / 2
attempts = 1
print("GUIDE: if the guess is correct, enter Y, if it is smaller than your number, enter S and if it is greater enter G")
while (not won):
  response = raw_input("is it " + str(guess) + "?")
  if (response == "Y"):
    won = True
  else:
    if (response == "G"):
      low_bound = guess
      guess = guess + (up_bound - guess) / 2
    else:
      up_bound = guess
      guess = low_bound + (guess - low_bound) / 2
  attempts += 1
  #print("low_bound = " + str(low_bound) + ", guess = " + str(guess) + " , up_bound = " + str(up_bound))
  
print("I'M A GENIUS, ONLY TOOK ME " + str(attempts) + " GUESSES TO GO THROUGH " + str(input_b - input_a) + " NUMBERS")