#include <iostream>
#include <cstdio>
#include <vector>
#include <complex>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <stack>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <cassert>

using namespace std;

typedef long long ll;
typedef ll li;
typedef pair<int,int> PI;
#define EPS (1e-10L)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define F first
#define S second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SZ(a) (int)((a).size())
#define ALL(a) a.begin(),a.end()
#define FOR(it,a) for(__typeof(a.begin())it=a.begin();it!=a.end();++it)
void pkuassert(bool t){t=1/t;};
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,-1,1,1,-1};


string in[100];
int H,W;
int pos[1000];
void solve(){
  cin >> H >> W;
  map<char,int> minx,miny,maxx,maxy;
  rep(i, H) cin >> in[i];
  rep(i, H) rep(j, W){
    char ch=in[i][j];
    if(ch=='.') continue;
    if(minx.count(ch))
      minx[ch]=min(minx[ch],i);
    else minx[ch]=i;

    if(miny.count(ch))
      miny[ch]=min(miny[ch],j);
    else miny[ch]=j;

    maxx[ch] = max(maxx[ch],i);
    maxy[ch] = max(maxy[ch],j);
  }

  string str;
  FOR(it,maxx) str += it->F;
  pos['.']=100;
  do{
    rep(i,SZ(str)) pos[(int)str[i]] = i;
    bool ok=true;
    rep(i,SZ(str)){
      char ch=str[i];
      int x1=minx[ch];
      int x2=maxx[ch];
      int y1=miny[ch];
      int y2=maxy[ch];
      for(int j=x1;j<=x2;++j)
        for(int k=y1;k<=y2;++k)
          if(pos[(int)in[j][k]]>i){
            ok=false;
            break;
          }
    }
    
    if(ok){
      cout << "SAFE" << endl;
      return;
    }
      
  }while(next_permutation(ALL(str)));

  cout << "SUSPICIOUS" << endl;
}

int main(int argc, char *argv[])
{
  int n;
  cin >> n;
  rep(i, n) solve();
  return 0;
}