The dollar gains for the second week