#include <bits/stdc++.h>

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b)-1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n)-1; i >= 0; i--)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n)-1; i >= 0; i--)
#define loop while(true)

#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()

#define PII pair<int, int>
#define pii pair<int, int>
#define VB vector<bool>
#define VVB vector<vector<bool> >
#define VI vector<int>
#define VVI vector<vector<int> >

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;




signed main()
{
    int test_num;
    cin >> test_num;
    rep(test, test_num){
        int h, w;
        cin >> h >> w;

        vector<vector<char> > image(h);
        rep(y, h){
            image[y].resize(w);
        }
        rep(y, h){
            rep(x, w){
                char ch;
                cin >> ch;
                image[y][x] = ch;
            }
        }
        
        int obj_num = 0;
        map<char, int> objects;
        vector<char> chars;
        vector<array<int, 4> > obj_point; // h_min, w_min, h_max, w_max
        
        rep(y, h){
            rep(x, w){
                if(image[y][x] != '.'){
                    char letter = image[y][x];
                    if(objects.find(letter) != objects.end()){
                        int index = objects[letter];
                        obj_point[index].at(0) = min(obj_point[index].at(0), y);
                        obj_point[index].at(1) = min(obj_point[index].at(1), x);
                        obj_point[index].at(2) = max(obj_point[index].at(2), y);
                        obj_point[index].at(3) = max(obj_point[index].at(3), x);
                    } else {
                        objects.insert(mp(letter, obj_num++));
                        chars.pb(letter);
                        array<int, 4> p = {y, x, y, x};
                        obj_point.pb(p);
                    }
                }
            }
        }

        bool flag = false;
        VVB to_graph(obj_num);
        rep(i, obj_num){
            to_graph[i].resize(obj_num);
        }
        rep(n, obj_num){
            VB over(obj_num, false);
            FOR(y, obj_point[n].at(0), obj_point[n].at(2)+1){
                FOR(x, obj_point[n].at(1), obj_point[n].at(3)+1){
                    char letter = image[y][x];
                    if(letter == '.'){
                        flag = true;
                        break;
                    }
                    else if(letter != chars[n]){
                        int index = objects[letter];
                        if(!over[index]){
                            // cout << chars[n] << " is coverred by " << letter << endl;
                            over[index] = true;
                            to_graph[index][n] = true;
                        }
                    }
                }
                if(flag) break;
            }
            if(flag) break;
        }

        if(!flag){
            queue<int> inits;
            rep(i, obj_num){
                bool non = true;
                rep(j, obj_num){
                    if(to_graph[j][i]) non = false;
                }
                if(non) inits.push(i);
            }
            
            vector<int> top(obj_num);
            while(!inits.empty()){
                int n = inits.front();
                inits.pop();
                top.pb(n);
                rep(i, obj_num){
                    if(to_graph[n][i]){
                        to_graph[n][i] = false;
                        bool non = true;
                        rep(j, obj_num){
                            if(to_graph[j][i]) non = false;
                        }
                        if(non) inits.push(i);
                    }
                }
            }

            rep(i, obj_num){
                rep(j, obj_num){
                    if(to_graph[i][j]){
                        flag = true;
                        break;
                    }
                }
                if(flag){
                    break;
                }
            }
        }
        
        if(flag){
            cout << "SUSPICIOUS" << endl;
        } else {
            cout << "SAFE" << endl;
        }
        
    }
    return 0;
}

Measured memory_bytes: 1232