Surface segregation of ternary alloys