#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

# define max_n 40

int main(void) {
    int i,j;
    int n;
    cin >> n;
    while(n--){
        int h, w;
        cin >> h >> w;
        vs s(h);
        rep(i,h) cin >> s[i];

        int a[26][4]; // left,right,top,bottom
        rep(i,26)rep(j,4)
            if(j%2) a[i][j] = 0;
            else a[i][j] = INF;
        rep(i,h)rep(j,w)if(s[i][j] >= 'A' && s[i][j] <= 'Z'){
            int alph = s[i][j] - 'A';
            a[alph][0] = min(a[alph][0], j);
            a[alph][1] = max(a[alph][1], j);
            a[alph][2] = min(a[alph][2], i);
            a[alph][3] = max(a[alph][3], i);
        }
        int cnt = 0;
        rep(i,26) if(a[i][0] < INF) cnt++;

        int t;
        bool ans = true;
        rep(t,cnt){
            if(ans == false)break;
            rep(i,26)if(a[i][0] < INF){
                int p,q;
                bool c = true;
                for(p = a[i][2]; p <= a[i][3]; p++){
                    for(q = a[i][0]; q <= a[i][1]; q++){
                        if(s[p][q] != ('A' + i) && s[p][q] != '*' ) c = false;
                    }
                }
                if(c){
                    for(p = a[i][2]; p <= a[i][3]; p++){
                        for(q = a[i][0]; q <= a[i][1]; q++){
                            s[p][q] = '*';
                        }
                    }
                    a[i][0] = INF;
                    break;
                }
            }
            if(i == 26) ans = false;
        }
        if(ans)
            cout << "SAFE" << endl;
        else
            cout << "SUSPICIOUS" << endl;
    }
}

