var q, n, m;
var x = [];
var s, t, g, d;

function dfs(i){
	d[i] = 1;
	for(var j in g[i]){
		if(!d[j]){
			if(dfs(j)){
				return true;
			} 
		}
		else if(d[j] === 1){
			return true;
		}
	}
	d[i] = 2;
	return false;
}

function main(){
	q = scan();
	rep(q, function(z){
		s = {};
		t = {};
		g = {};
		d = {};

		n = scan();
		m = scan();
		rep(n, function(i){
			x[i] = scan_string().split('');
		});

		rep(n, function(i){
			rep(m, function(j){
				var a = x[i][j];
				if(a == '.'){
					return;
				}
				if(!s[a]){
					s[a] = [i, j];
					t[a] = [i, j];
				}
				else{
					s[a] = [Math.min(i, s[a][0]), Math.min(j, s[a][1])];
					t[a] = [Math.max(i, t[a][0]), Math.max(j, t[a][1])];
				}
			});
		});

		for(var a in s){
			g[a] = {};
		}

		var b = true;
		for(var a in s){
			rep(s[a][0], t[a][0] + 1, function(i){
				rep(s[a][1], t[a][1] + 1, function(j){
					if(x[i][j] == '.'){
						b = false;
						return false;
					}
					else if(x[i][j] != a){
						g[a][x[i][j]] = true;
					}
				});
				if(!b){
					return false;
				}
			});
			if(!b){
				break;
			}
		}
		if(!b){
			print('SUSPICIOUS');
			return;
		}

		for(var a in s){
			if(!d[a] && dfs(a)){
				print('SUSPICIOUS');
				return;
			}
		}

		print('SAFE');
	});
}

function rep(a, b, c){
	if(c === undefined){
		c = b;
		b = a;
		a = 0;
	}
	for(var i = a; i < b; ++i){
		if(c(i) === false){
			break;
		}
	}
}
 
process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var input = '';
var input_index = 0;
 
function scan(){
	return +input[input_index++];
}

function scan_string(){
	return input[input_index++];
}
 
function print(val){
	console.log(val);
}
 
process.stdin.on('data', function(chunk){
	input += chunk;
});
process.stdin.on('end', function(){
	input = input.trim().split(/\s+/);
	main();
});