#include<string>
#include<iostream>
#include<queue>
#include<algorithm>

using namespace std;

typedef pair<short,short> pos;

string board[8];

const int DIR_R[8] = {-1,-1,0,1,1,1,0,-1};
const int DIR_C[8] = {0,1,1,1,0,-1,-1,-1};

int pred[1<<20];

inline int make_pos(int mask,int r,int c) {
  return (mask<<6)|(r<<3)|c;
}

inline int pos_mask(int pos) { return (pos >> 6); }

inline int pos_row(int pos) { return (pos >> 3) & 0x7; }

inline int pos_col(int pos) { return pos & 0x7; }

int main() {
  int S;
  cin >> S;

  for (int scen=1; scen <= S; ++scen) {
    getline(cin,board[0]); // read rest of line / dummy line
    cout << "Scenario #" << scen << ":" << endl;
    for (int i=0; i < 8; ++i) {
      getline(cin, board[7-i]);
    }

    pos queen(-1,-1);
    pos bishop(-1,-1);
    int adj[8][8] = {};
    int knights=0;
    for (int r=0; r < 8; ++r) {
      for (int c=0; c < 8; ++c) {
        if (board[r][c] == 'Q') {
          queen = make_pair(r,c);
          board[r][c] = '.';
        } else if (board[r][c] == 'B') {
          bishop = make_pair(r,c);
        } else if (board[r][c] == 'N') {
          for (int d=0; d < 8; ++d) {
            int rr=r+DIR_R[d], cc=c+DIR_C[d];
            if (rr < 0 || rr >= 8 || cc < 0 || cc >= 8) continue;
            adj[rr][cc] |= 1<<knights;
          }
          ++knights;
        }
      }
    }
    fill(pred,pred+(1<<20),-1);
    
    int mask_done = (1<<knights)-1;

    vector<pos> moves[8][8];
    for (int r=0; r < 8; ++r) {
      for (int c=0; c < 8; ++c) {
        if (board[r][c] != '.') continue;
        for (int d=0; d < 8; ++d) {
          int rr = r+DIR_R[d], cc =c+DIR_C[d];
          while (rr >= 0 && rr < 8 && cc >= 0 && cc < 8 && board[rr][cc] == '.') {
            moves[r][c].push_back(make_pair(cc,rr));
            rr += DIR_R[d];
            cc += DIR_C[d];
          }
        }
      }
    }
    for (int r=0; r < 8; ++r)
      for (int c=0; c < 8; ++c)
        sort(moves[r][c].begin(),moves[r][c].end());
    
    queue<int> q;
    int start = make_pos(adj[queen.first][queen.second],queen.first,queen.second);
    pred[start] = -2;
    q.push(start);

    bool found = false;
    while (!q.empty()) {
      int cur = q.front(); q.pop();
      int mask = pos_mask(cur);
      int r = pos_row(cur), c=pos_col(cur);
      if (mask == mask_done && abs(r-bishop.first) <= 1 && abs(c-bishop.second) <= 1) {
          string path;
          while (cur != -2) {
            path += ('1'+pos_row(cur));
            path += ('a'+pos_col(cur));
            cur = pred[cur];
          }
          reverse(path.begin(),path.end());
          cout << path << endl;
          found = true;
          break;
      }
      for (vector<pos>::iterator i=moves[r][c].begin(); i != moves[r][c].end(); ++i) {
        short rr = i->second, cc = i->first;
        int mask2 = mask | adj[rr][cc];
        int next = make_pos(mask2,rr,cc);
        if (pred[next] == -1) {
          pred[next] = cur;
          q.push(next);
        }
      }
    }
    if (!found) {
      cout << "impossible" << endl;
    }
    cout << endl;
  }
}
