# Toy LATS: generate candidate actions, score them, and select the best branch.
def score(action):
    values = {"search documentation": 8, "guess answer": 2,
              "run a test": 9, "ask for clarification": 7}
    return values.get(action, 1)

question = input("Enter task: ")
actions = ["search documentation", "guess answer",
           "run a test", "ask for clarification"]
print("Root node:", question)
for action in actions:
    print("Candidate:", action, "score:", score(action))
best = max(actions, key=score)
print("Selected branch:", best)
print("Final action:", best)
