Surface segregation during reactive etching of GaAs and InP