Appearance of antiferromagnetism and superconductivity in superconducting cuprates