Gravar-mail: Flexible bed allocations for hospital wards