P2923 [USACO08DEC] Winning Checkers G

Description

The cows have taken up the game of checkers with a vengeance. Unfortunately, despite their unlimited enjoyment of playing, they are terrible at the endgame and want your help. Given an NxN (4

Input Format

\* Line 1: A single integer: N \* Lines 2..N+1: Line i+1 contains N characters (each one of: '-', '+', 'K', or 'o') that represent row i of a proper checkboard. Line 2 always begins with '-'.

Output Format

\* Lines 1..?: If there is no winning sequence of jump, output 'impossible' on a line by itself. If such a sequence exists, each line contains two space-separated integers that represent successive locations of a king whose moves will win the game. Any such sequence is acceptable.