So he brought them before the king of Moab, and they dwelt with him all the time that David was in the stronghold.