[SUBS]RANK

Problem 256, MIT's Infinite History