Learning to reach goals via iterated supervised learning