Large Language Models can Implement Policy Iteration