Problem A
Evil Straw Warts Live

-
swap “ad” to yield “mamda”
-
swap “md” to yield “madma”
-
swap “ma” to yield “madam”
Input
The first line of input gives
Output
Output consists of one line per test case. This line will contain the number of swaps, or “Impossible” if it is not possible to transform the input to a palindrome.
Sample Input 1 | Sample Output 1 |
---|---|
3 mamad asflkj aabb |
3 Impossible 2 |