#include<iostream>
#include<vector>
#include<cstring>
#include<map>
#include<cassert>

using namespace std;

const int MAX = 51;
const int GOODS = 8;
struct data{
  char c;
  int maxX,maxY,minX,minY;
};
vector<data> V;
map<char,int> M;
bool come[MAX][MAX];
char field[MAX][MAX];
int W,H,cnt;
int dx[] = {0,1,0,-1};
int dy[] = {1,0,-1,0};
bool Edge[GOODS][GOODS];

void init(){
  cnt=0;
  V.clear();
  M.clear();
  memset(come,false,sizeof(come));
  memset(Edge,false,sizeof(Edge));
}

void input(){
  cin >> H >> W;
  for(int i = 0; i < H; i++)
    for(int j = 0; j < W; j++) cin >> field[i][j];
}

void set(char c, int x, int y){
  for(int i = 0; i < V.size(); i++)
    if(c == V[i].c){
      V[i].maxX = max(V[i].maxX,x);
      V[i].maxY = max(V[i].maxY,y);
      V[i].minX = min(V[i].minX,x);
      V[i].minY = min(V[i].minY,y);
      return;
    }
  
  V.push_back((data){c,x,y,x,y});
  M[c] = ++cnt;
}

bool isInside(int x, int y){ return 0<=x&&x<W&&0<=y&&y<H;}

void rec(int x, int y, char c){
  
  if(come[y][x]) return;
  come[y][x] = true;
  set(c,x,y);

  for(int i = 0; i < 4; i++){
    int nx = x+dx[i];
    int ny = y+dy[i];
    if(isInside(nx,ny) && field[ny][nx] == c) rec(nx,ny,c);
  }
}

bool check(data d){
  for(int i = d.minY; i <= d.maxY; i++)
    for(int j = d.minX; j <= d.maxX; j++)
      if(field[i][j] == '.') return false;
      else if(d.c != field[i][j]) Edge[M[d.c]][M[field[i][j]]] = true;
  return true;
}

bool circle(){

  for(int i = 1; i <= cnt; i++)
    for(int j = 1; j <= cnt; j++)
      for(int k = 1; k <= cnt; k++) Edge[i][j] = Edge[i][j]||Edge[i][k]&&Edge[k][j];

  for(int i = 1; i <= cnt; i++)
    if(Edge[i][i]) return true;
  return false;
}

void solve(){
  for(int i = 0; i < H; i++)
    for(int j = 0; j < W; j++)
      if(!come[i][j] && field[i][j] != '.') rec(j,i,field[i][j]);
    

  for(int i = 0; i < V.size(); i++)
    if(!check(V[i])){
      cout << "SUSPICIOUS" << endl;
      return;
    }

  if(!circle()) cout << "SAFE" << endl;
  else cout << "SUSPICIOUS" << endl;
}

int main(){
  int T;
  cin >> T;
  while(T--){
    init();
    input();
    solve();
  }
  return 0;
}