def solve(f, p)
    done = Array.new
    p.each do |c|
        t = l = 100
        b = r = -1
        f.each_with_index do |row, i|
            row.each_char.with_index do |ch, j|
                if ch == c
                    t = i if i < t
                    l = j if j < l
                    b = i if i > b
                    r = j if j > r
                end
            end
        end
        for i in t..b
            for j in l..r
                return false if f[i][j] != c && !done.include?(f[i][j])
            end
        end
        done.push(c)
    end
    return true
end

n = gets.to_i
n.times do
    h, w = gets.split.map(&:to_i)
    f = h.times.map{gets.chomp}
    keys = Array.new
    f.each do |r|
        r.each_char do |c|
            keys.push(c) if !keys.include?(c) && c != "."
        end
    end
    if keys.empty?
        puts "SAFE"
        next
    end
    b = false
    keys.permutation(keys.size) do |p|
        b = solve(f, p)
        break if b
    end
    puts b ? "SAFE" : "SUSPICIOUS"
end