Electronic structure of P-type and N-type cuprate superconductors