A multiperiod MINLP model for the synthesis of flexible heat and mass exchange networks