Stock indexes gain after Amazon-OpenAI deal; dollar rise to 3-month high vs euro