First principles study of 3d transition metal doped Cu3N