sorting hands into ranks