Sorting by residential type and agent id.