Task 4
nextpreferred(person,index,pref)