Shalane Flanagan wins women's division