#include <bits/stdc++.h>
using namespace std;
int T, row, col;
string s;
void mov(int x, int y) {
  printf("%d %d\n", x, y);
  col = y;
  cin >> s;
}
int scan(int row) {
  for (int c = (col == 1 ? 2 : 1); c <= 8; ++c) {
    mov(row, c);
    if (s == "Done") return true;
    if (s.find("Down") != -1) return false;
    if (s.find("Up") != -1) return scan(row);
  }
  return false;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    col = 1;
    for (int row = 1; row <= 8; row++) {
      mov(row, col);
      if (col != 1) {
        if (s == "Done") break;
        col = 1;
        mov(row, col);
      }
      if (s == "Done") break;
      if (scan(row)) break;
    }
  }
  return 0;
}
