First-principles study of Mn3 adsorbed on Au(111) and Cu(111) surfaces