During which stage of the cell cycle does the genetic material replicate so that there are two sets of DNA?

1) G2 stage
2) M stage
3) G1 stage
4) S stage