#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define dme cout<<"IMPOSSIBLE"<<endl;return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
//12:15~
const int mod=1e9+7;
const int big=1e9+100;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
void solve(void){
	int h,w,i,j,c;cin>>h>>w;
	vector<string> kai(h);
	for(i=0;i<h;i++){cin>>kai[i];}
	int dame[26][26]={};
	array<int,26> up,dow,lef,rig;
	for(c=0;c<26;c++){up[c]=h;lef[c]=w;dow[c]=0;rig[c]=0;}
	int has[26]={0};
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(kai[i][j]=='.'){continue;}
			mineq(up[kai[i][j]-'A'],i);
			maxeq(dow[kai[i][j]-'A'],i);
			mineq(lef[kai[i][j]-'A'],j);
			maxeq(rig[kai[i][j]-'A'],j);
			has[kai[i][j]-'A']=1;
		}
	}
	for(c=0;c<26;c++){
		for(i=up[c];i<=dow[c];i++){
			for(j=lef[c];j<=rig[c];j++){
				if(kai[i][j]=='.'){cout<<"SUSPICIOUS"<<endl;return;}
				dame[c][kai[i][j]-'A']=1;
			}
		}
	}
	vector<int> pa;
	for(c=0;c<26;c++){if(has[c]){pa.pub(c);}}
	int n=pa.size();
	do{
		int ok=1;
		for(i=0;i<n;i++){
			for(j=i+1;j<n;j++){
				if(dame[pa[i]][pa[j]]){ok=0;break;}
			}
		}
		if(ok==1){cout<<"SAFE"<<endl;return;}
	}while(next_permutation(pa.begin(),pa.end()));
	cout<<"SUSPICIOUS"<<endl;return;
}
int main(void){
	int n;cin>>n;
	while(n--){solve();}
	return 0;
}