Four friends - A, B, C, and D - have different pets: a dog, a cat, a bird, and a fish. A does not have a dog or a cat. B has a pet that is not a bird. C does not have a fish. Who has the cat?
If the input sequence is '1 2 3 4 5', what will be the output after applying the rearrangement steps: Step 1: Move '5' to the front, Step 2: Swap '2' and '3'?