#include<stdio.h>

#define MAX_H 50
#define MAX_W 50

typedef struct {
	int top, bottom, left, right;
} EDGE;


int n;
int h, w;
char img[MAX_H][MAX_W];


void edge_check( EDGE *edge, int ximg[MAX_H][MAX_W], int y, int x, char alfa )
{
	ximg[y][x] = 1;
	if ( y < edge->top ) edge->top = y;
	else if ( y > edge->bottom ) edge->bottom = y;
	else if ( x > edge->right ) edge->right = x;
	else if ( x < edge->left ) edge->left = x;
	
	if ( img[y+1][x] == alfa && ximg[y+1][x] == 0 && y+1 < h ) edge_check( edge, ximg, y+1, x, alfa );
	if ( img[y-1][x] == alfa && ximg[y-1][x] == 0 && y-1 >= 0) edge_check( edge, ximg, y-1, x, alfa );
	if ( img[y][x+1] == alfa && ximg[y][x+1] == 0 && x+1 < w ) edge_check( edge, ximg, y, x+1, alfa );
	if ( img[y][x-1] == alfa && ximg[y][x-1] == 0 && x-1 >= 0) edge_check( edge, ximg, y, x-1, alfa);
	
}

int scanx( void )
{
	int i, j, k, item_n;
	char alfa[7];
	EDGE edge[7];
	int ximg[MAX_H][MAX_W];
	
	item_n = 0;
	
	for( i=0; i<h; i++ ) {
		for( j=0; j<w; j++ ) {
			ximg[i][j] = 0;
		}
	}
	
	for( i=0; i<h; i++ ) {
		for( j=0; j<w; j++ ) {
			if ( ximg[i][j] == 0 && img[i][j] != '.' ) {
				edge[item_n].top = edge[item_n].bottom = i;
				edge[item_n].left = edge[item_n].right = j;
				alfa[item_n] = img[i][j];
				edge_check( &edge[item_n], ximg, i, j, alfa[item_n]);
				item_n++;
				}
		}
	}

	for( i=0; i<item_n; i++ ) {
		
		for( j=edge[i].top; j<=edge[i].bottom; j++ ) {		//????????¢???????????????
			for( k=edge[i].left; k<=edge[i].right; k++ ) {
				if ( img[j][k] != alfa[i] && img[j][k] != '0' )
					goto _exit;
			}
		}
		
		for( j=edge[i].top; j<=edge[i].bottom; j++ ) {
			for( k=edge[i].left; k<=edge[i].right; k++ ) {
				img[j][k] = '0';
			}
		}
		
		item_n--;			//????????????????¬?????????¢???
		for( j=i; j<=item_n; j++ ) {
			edge[j] = edge[j+1];
			alfa[j] = alfa[j+1];
		}
		i = -1;
		
		_exit:;
	}
	
	if( item_n == 0 ) return 0;
	else return 1;
}

int main(void)
{
	int i;
	
	scanf( "%d", &n );
	
	while( n-- ) {
		
		scanf( "%d %d", &h, &w );
		
		for( i=0; i<h; i++ ) {
			scanf( "%s", img[i] );
		}
		
		if ( scanx() == 0 ) printf( "SAFE\n" );
		else printf( "SUSPICIOUS\n" );
		
	}
	
	return 0;
}