Suppose we have three numbers. Now let's imagine that they are not numbers, but people ... Actually, never mind about that. We don't need to make this weird. Let's just check if there is at least one pair of identical numbers among the three. If there is, we'll display it on the screen. And if the three numbers are the same, we'll display all three.
Do we have a pair?