def search(tree, key):
while True:
try:
if tree.value.startswith(key):
print(tree.value, tree.count)
return
elif key < tree.value:
tree = tree.left
elif key > tree.value:
tree = tree.right
except AttributeError:
print('Word' + key + ' is not found')
return