Theoretical study of the first transition row oxides and sulfides