Here's a pop quiz for you. Tom is taller than Dick. Dick is taller than Harry. Who's taller, Harry or Tom?
If you said Tom, congratulations! You just demonstrated what's called "transitive inference" - the ability to compare things indirectly, based on previous juxtapositions. But before you pat yourself on the back too much, you should know that this skill was recently demonstrated by another creature: the humble paper wasp.