solves rankall assignment