#include<stdio.h>
#include<stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

int b[30][4];

int main(){
	ll q;
	scanf("%lld",&q);
	while(q--){
		rep(i,0,26){
			b[i][0]=100;
			b[i][1]=-1;
			b[i][2]=100;
			b[i][3]=-1;
		}
		ll h,w;
		scanf("%lld%lld",&h,&w);

		int cnt=0;
		char s[60][60]={};
		rep(i,0,h)rep(j,0,w){
			scanf(" %c",&s[i][j]);
			if(s[i][j]!='.'){
				int c=s[i][j]-'A';
				if(b[c][0]==100)cnt++;
				b[c][0]=min(b[c][0],i);
				b[c][1]=max(b[c][1],i);
				b[c][2]=min(b[c][2],j);
				b[c][3]=max(b[c][3],j);
			}
		}
		//cnt種
		int flag=1;
		while(flag){
			flag=0;
			rep(c,0,26)if(b[c][0]!=100){
				int temp=1;
				rep(i,b[c][0],b[c][1]+1)rep(j,b[c][2],b[c][3]+1){
					if(s[i][j]!=' '&&s[i][j]!=c+'A'){
						temp=0;i=j=100;
					}
				}
				if(temp){
					rep(i,b[c][0],b[c][1]+1)rep(j,b[c][2],b[c][3]+1)s[i][j]=' ';
					cnt--;
					flag=1;
					b[c][0]=100;
				}
			}
		}
//		rep(i,0,h)puts(s[i]);
		puts(cnt?"SUSPICIOUS":"SAFE");
	}
}
