For each test case output on a single line the minimum number of moves required to get all three pieces onto the same location, or the word "impossible" if that is not possible for the given board and starting locations.3 1 2 3 r b r b b b r b r 2 1 2 2 y g g y 0
2 impossible