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

int N;
vector<string> g;
int used[128],x1[128],x2[128],y1[128],y2[128];
vector<int> p;

vector<char> v;
bool bt(){

	for(int k=0;k<p.size();k++){
		for(int i=y1[p[k]];i<=y2[p[k]];i++){
			for(int j=x1[p[k]];j<=x2[p[k]];j++){
				char c = g[i][j];
				if(c == '.')return false;
				if(find(p.begin(),p.end(),p[k]) > find(p.begin(),p.end(),c)){
					return false;
				}
			}			
		}
	}

	for(int k=0;k<v.size();k++){
		if(!used[v[k]]){
			used[v[k]] = true;
			p.push_back(v[k]);
			if( bt() ) return true;
			p.pop_back();
			used[v[k]] = false;
		}
	}
	return p.size() == v.size();
}
int main(){
	int T;
	
	cin >> T;
	while(T--){
		int W,H;
		cin >> H >> W;
		vector<string> data(H);
		for(int i=0;i<H;i++)
			cin >> data[i];
			
		g = data;
		
		int check[128];
		
		for(int i=0;i<128;i++)
			x1[i] = x2[i] = y1[i] = y2[i] = used[i] = check[i] = 0;

		for(int i=0;i<128;i++)
			x1[i] = y1[i] = 9999;
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				char c = data[i][j];
				if(c != '.'){
					check[c] = true;
					x1[c] = min(j,x1[c]);
					x2[c] = max(j,x2[c]);
					y1[c] = min(i,y1[c]);
					y2[c] = max(i,y2[c]);
				}
			}
		}
		
		v.clear();
		p.clear();
		
		for(int i=0;i<128;i++)
			if(check[i])v.push_back(i);

			
		cout << ( bt() ? "SAFE" : "SUSPICIOUS") << endl;
	}
}