The Ramsey theorem and the raibow Ramsey theorem in second-order arithmetic