It was a winning week for the three major averages.