#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <vector>

using namespace std;

const int N = 50;

class State{
public:
  int mx, my, Mx, My;
  State() {}
  State(int mx, int my, int Mx, int My) : mx(mx), my(my), Mx(Mx), My(My) {}
};

int h, w, col, mx, my, Mx, My, A[7], dy[] = {-1, 0, 1, 0}, dx[] = {0, 1, 0, -1};
State state[7];
char data[N][N];
bool used[N][N], ans;
map<char, int> number;
map<int, char> material;

main(){
  int t;
  cin >> t;
  while(t--){
    set<int> upper[7];
    number.clear();
    material.clear();
    cin >> h >> w;
    col = 0;
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        cin >> data[i][j];
        if(data[i][j] != '.' && number.find(data[i][j]) == number.end()){
          number[data[i][j]] = col;
          material[col++] = data[i][j];
        }
      }
    }
    for(int k=0;k<col;k++){
      state[k] = State(N, N, 0, 0);
      for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
          if(data[i][j] == material[k]){
            state[k].mx = min(state[k].mx, j);
            state[k].my = min(state[k].my, i);
            state[k].Mx = max(state[k].Mx, j);
            state[k].My = max(state[k].My, i);
          }
        }
      }
    }
    for(int k=0;k<col;k++){
      for(int i=state[k].my;i<=state[k].My;i++){
        for(int j=state[k].mx;j<=state[k].Mx;j++){
          if(data[i][j] == '.'){
            cout << "SUSPICIOUS" << endl;
            goto CONT;
          }
          else if(data[i][j] != material[k]) upper[k].insert(number[data[i][j]]);
        }
      }
    }
    for(int i=0;i<col;i++) A[i] = i;
    ans = false;
    do{
      for(int i=0;i<col;i++){
        for(set<int>::iterator j=upper[i].begin();j!=upper[i].end();j++){
          if(A[i] < A[*j]) goto FAILD;
        }
      }
      ans = true;
      FAILD:;
    }while(next_permutation(A, A+col));
    if(ans || !col) cout << "SAFE" << endl;
    else cout << "SUSPICIOUS" << endl;
    CONT:;
  }
}