[SUBS]RANK

Solution to problem 247