Abinitio determination of crystal structures of the thermoelectric material MgAgSb