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

const int AtoZ = 'Z'-'A'+1;
struct limbox{
    int u,d,l,r;
    limbox():u(100),d(-1),l(100),r(-1){}
};

vector<vector<bool> > o;
vector<bool> s;
vector<bool> c;

bool check(int k){
    if(s[k]) return true;
    if(c[k]) return false;
    c[k] = true;
    for(int i=0; i<AtoZ; i++){
        if(o[k][i] && !check(i)){
            return false;
        }
    }
    c[k] = false;
    s[k] = true;
    return true;
}
            

int main(){
    int n;
    cin >> n;
    
    for(int rep=0; rep<n; rep++){
        int h,w;
        cin >> h >> w;
        vector<vector<char> > mat(h, vector<char>(w));
        vector<limbox> dom(AtoZ);
        for(int i=0; i<h; i++){
            for(int j=0; j<w; j++){
                cin >> mat[i][j];
                if(mat[i][j]!='.'){
                    int c = mat[i][j] - 'A';
                    dom[c].u = min(dom[c].u, i);
                    dom[c].d = max(dom[c].d, i);
                    dom[c].l = min(dom[c].l, j);
                    dom[c].r = max(dom[c].r, j);
                }
            }
        }

        vector<vector<bool> > ovl(AtoZ, vector<bool>(AtoZ, false));
        vector<bool> safe(AtoZ, true);
        bool suspicious = false;
        for(int k=0; k<AtoZ; k++){
            for(int i=dom[k].u; i<=dom[k].d; i++){
                for(int j=dom[k].l; j<=dom[k].r; j++){
                    if(mat[i][j]=='.'){
                        suspicious = true;
                        safe[k] = false;
                    }else if(mat[i][j] != 'A'+k){
                        ovl[k][mat[i][j]-'A'] = true;
                        safe[k] = false;
                    }
                }
            }
        }
        if(suspicious){
            cout << "SUSPICIOUS" << endl;
            continue;
        }

        vector<bool> checking(AtoZ, false);
        o = ovl;
        s = safe;
        c = checking;
        for(int i=0; i<AtoZ; i++){
            if(!check(i)){
                suspicious = true;
            }
        }
        if(!suspicious){
            cout << "SAFE" << endl;
        }else{
            cout << "SUSPICIOUS" << endl;
        }
    }
    return 0;
}