S&P 500 logs 3rd weekly gain as Fed hold bets firm