Extracting Prompts by Inverting LLM Outputs