#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {

  long long int t;
  cin >> t;

  for ( long long int tt = 0; tt < t; tt++ ) {

    long long int h, w;
    cin >> h >> w;

    vector< string > m;

    long long int min_x[26] = {};
    long long int max_x[26] = {};
    long long int min_y[26] = {};
    long long int max_y[26] = {};

    for ( long long int i = 0; i < 26; i++ ) {
      min_x[i] = w;
      max_x[i] = -1;
      min_y[i] = h;
      max_y[i] = -1;
    }

    for ( long long int i = 0; i < h; i++ ) {

      string in;
      cin >> in;
      m.push_back( in );

      for ( long long int j = 0; j < w; j++ ) {

	if ( in[j] == '.' ) continue;
	long long int k = in[j] - 'A';
	min_x[ k ] = min( min_x[k], j );
	max_x[ k ] = max( max_x[k], j );
	min_y[ k ] = min( min_y[k], i );
	max_y[ k ] = max( max_y[k], i );

      }

    }

    bool f = true;

    while( f ) {

      f = false;

      for ( long long int i = 0; i < 26; i++ ) {

	if ( max_x[i] < 0 ) continue;

	bool ff = true;

	for ( long long int x = min_x[i]; x <= max_x[i]; x++ ) {
	  for ( long long int y = min_y[i]; y <= max_y[i]; y++ ) {

	    if ( m[y][x] != '*' && m[y][x] != 'A' + i ) {
	      ff = false;
	      break;
	    }

	  }
	  if ( ff == false ) break;
	}

	if ( ff == true ) {
	  f = true;
	  for ( long long int x = min_x[i]; x <= max_x[i]; x++ ) {
	    for ( long long int y = min_y[i]; y <= max_y[i]; y++ ) {
	      m[y][x] = '*';
	    }
	  }
	  max_x[i] = -1;
	}

      }

    }

    string out = "SAFE";
    for ( long long int i = 0; i < 26; i++ ) {
      if ( max_x[i] >= 0 ) {
	out = "SUSPICIOUS";
	break;
      }
    }
    cout << out << endl;


  }

  return 0;

}