Training LLMs on trajectories of reasoning and tool use makes them superior at multi-step reasoning tasks.