#include <bits/stdc++.h>

using namespace std;

bool impossible(char ch1, set<char> has, map<char, set<char> > mp) {
  if (has.find(ch1) != has.end()) return true;
  has.insert(ch1);

  bool res = false;
  for (auto ch2 : mp[ch1]) {
    res |= impossible(ch2, has, mp);
  }
  return res;
}

void solve(void) {
  int h, w;
  cin >> h >> w;

  vector<string> s(h);
  for (int i = 0; i < h; i++) {
    cin >> s[i];
  }

  set<char> st;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (s[i][j] != '.') {
        st.insert(s[i][j]);
      }
    }
  }

  bool ng = false;
  map<char, set<char> > mp;
  for (auto ch : st) {
    int u = 51, d = -1, l = 51, r = -1;
    for (int i = 0; i < h; i++) {
      for (int j = 0; j < w; j++) {
        if (s[i][j] == ch) {
          u = min(u, i);
          d = max(d, i);
          l = min(l, j);
          r = max(r, j);
        }
      }
    }

    for (int i = u; i <= d; i++) {
      for (int j = l; j <= r; j++) {
        if (s[i][j] == '.') {
          ng = true;
        } else if (s[i][j] != ch) {
          mp[ch].insert(s[i][j]);
        }
      }
    }
  }

  for (auto ch1 : st) {
    set<char> has;
    has.insert(ch1);
    for (auto ch2 : mp[ch1]) {
      ng |= impossible(ch2, has, mp);
    }
  }

  cout << (ng ? "SUSPICIOUS" : "SAFE") << endl;
}

int main(void) {
  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    solve();
  }

  return 0;
}
