A chess tournament will be held soon, where n chess players will take part. Every participant will play one game against every other participant. Each game ends in either a win for one player and a loss for another player, or a draw for both players.

Each of the players has their own expectations about the tournament, they can be one of two types:

  1. a player wants not to lose any game (i. e. finish the tournament with zero losses); 
  2. a player wants to win at least one game. 



You have to determine if there exists an outcome for all the matches such that all the players meet their expectations. If there are several possible outcomes, print any of them. If there are none, report that it's impossible.

Input

The first line contains a single integer t (1 ≤ t ≤ 200) — the number of test cases.

The first line of each test case contains one integer n (2 ≤ n ≤ 50) — the number of chess players.

The second line contains the string s (|s| = n; s_i ∈ \{1, 2\}). If s_i = 1, then the i-th player has expectations of the first type, otherwise of the second type.

Output

For each test case, print the answer in the following format:

In the first line, print NO if it is impossible to meet the expectations of all players.

Otherwise, print YES, and the matrix of size n × n in the next n lines.

The matrix element in the i-th row and j-th column should be equal to:

  * +, if the i-th player won in a game against the j-th player; 
  * -, if the i-th player lost in a game against the j-th player; 
  * =, if the i-th and j-th players' game resulted in a draw; 
  * X, if i = j. 

Example

Input


3
3
111
2
21
4
2122


Output


YES
X==
=X=
==X
NO
YES
X--+
+X++
+-X-
--+X

/*
 
    /$$$$$  /$$$$$$  /$$    /$$  /$$$$$$                                                                  
   |__  $$ /$$__  $$ |$$    |$$ /$$__  $$                                                                 
          | $$| $$  \ $$|    $$|$$| $$  \ $$                                                                 
          | $$| $$$$$$$$|  $$ / $$/| $$$$$$$$                                                                 
/ $$  | $$| $$__  $$ \  $$ $$/ | $$__  $$                                                                 
| $$  | $$| $$  | $$  \  $$$/  | $$  | $$                                                                 
|  $$$$$$/| $$  | $$   \  $/   | $$  | $$                                                                 
 \______/ |__/  |__/    \_/    |__/  |__/    
 
/$$$$$$$  /$$$$$$$   /$$$$$$   /$$$$$$  /$$$$$$$   /$$$$$$  /$$      /$$ /$$      /$$ /$$$$$$$$ /$$$$$$$ 
| $$__  $$| $$__  $$ /$$__  $$ /$$__  $$| $$__  $$ /$$__  $$| $$$    /$$$| $$$    /$$$| $$_____/| $$__  $$
| $$  \ $$| $$  \ $$| $$  \ $$| $$  \__/| $$  \ $$| $$  \ $$| $$$$  /$$$$| $$$$  /$$$$| $$      | $$  \ $$
| $$$$$$$/| $$$$$$$/| $$  | $$| $$ /$$$$| $$$$$$$/| $$$$$$$$| $$ $$/$$ $$| $$ $$/$$ $$| $$$$$   | $$$$$$$/
| $$____/ | $$__  $$| $$  | $$| $$|_  $$| $$__  $$| $$__  $$| $$  $$$| $$| $$  $$$| $$| $$__/   | $$__  $$
| $$      | $$  \ $$| $$  | $$| $$  \ $$| $$  \ $$| $$  | $$| $$\  $ | $$| $$\  $ | $$| $$      | $$  \ $$
| $$      | $$  | $$|  $$$$$$/|  $$$$$$/| $$  | $$| $$  | $$| $$ \/  | $$| $$ \/  | $$| $$$$$$$$| $$  | $$
|__/      |__/  |__/ \______/  \______/ |__/  |__/|__/  |__/|__/     |__/|__/     |__/|________/|__/  |__/
                                                                                                                                                                                                                
                                                                                                                                                                                                                
 
*/

import java.util.*;
import java.lang.*;
import java.io.*;

public class ChessTournament {
    public static void main(String[] args) throws java.lang.Exception {
        // your code goes here
        //try {
            // Scanner sc=new Scanner(System.in);
            FastReader sc = new FastReader();
            int t =sc.nextInt();
            while (t-- > 0) {
                int n=sc.nextInt();
                char[] arr=sc.next().toCharArray();
                TreeSet<Integer> ts=new TreeSet<>();
                int tc=0;
                for(int i=0;i<n;i++){
                    if(arr[i]=='2'){
                        ts.add(i);
                        tc++;
                    }
                }
                if(tc==1 || tc==2){
                    System.out.println("NO");
                    continue;
                }
                else if(tc==0){
                    char[][] ans=new char[n][n];
                    for(int i=0;i<n;i++){
                        for(int j=0;j<n;j++){
                            ans[i][j]='=';
                        }
                    } 
                    for(int i=0;i<n;i++){
                        ans[i][i]='X';
                    }
                    for(int i=0;i<n;i++){
                        for(int j=0;j<n;j++){
                            System.out.print(ans[i][j]+" ");
                        }
                        System.out.println();
                    } 
                    System.out.println();
                    continue;
                }
                char[][] ans=new char[n][n];
                for(int i=0;i<n;i++){
                    for(int j=0;j<n;j++){
                        ans[i][j]='0';
                    }
                }
                for(int i=0;i<n;i++){
                    ans[i][i]='X';
                }
                int fst=ts.first();
                ts.remove(fst);
                int snd=ts.first();
                ts.remove(snd);
                int trd=ts.first();
                ts.add(snd);
                //for(int it:ts)System.out.print(it+" ---> ");
                ans[fst][snd]='+';
                ans[snd][fst]='-';
                boolean pos=true;
                for(int it:ts){
                    if(it==snd){
                        ans[snd][trd]='+';
                        ans[trd][snd]='-';
                    }
                    else{
                        if(ans[it][fst]!='0'){
                            if(ans[it][snd]!='0' || ans[snd][it]!='0'){
                                pos=false;
                            }
                            else{
                                ans[it][snd]='+';
                                ans[snd][it]='-';
                            }
                        }
                        else{
                            ans[it][fst]='+';
                            ans[fst][it]='-';
                        }
                    }
                }
                for(int i=0;i<n;i++){
                    for(int j=0;j<n;j++){
                        if(ans[i][j]=='0'){
                            if(ans[j][i]=='0'){
                                ans[i][j]='=';
                                ans[j][i]='=';
                            }
                            else{
                                pos=false;
                            }
                            
                        }
                        else if(ans[i][j]=='+'){
                            if(ans[j][i]!='-'){
                                pos=false;
                            }
                        }
                        else if(ans[i][j]=='-'){
                            if(ans[j][i]!='+'){
                                pos=false;
                            }
                        }
                    }
                }
                if(!pos){
                    System.out.println("NO");
                }
                else{
                    System.out.println("YES");
                    for(int i=0;i<n;i++){
                        for(int j=0;j<n;j++){
                            System.out.print(ans[i][j]);
                        }
                        System.out.println();
                    }
                }
                /*int[] arr=new int[n];
                for(int i=0;i<n;i++){
                    arr[i]=sc.nextInt();
                }*/
                /*long[] arr=new long[n];
                for(int i=0;i<n;i++){
                    arr[i]=sc.nextLong();
                }*/
            }
        /*} catch (Exception e) {
            return;
        }*/

    }
    public static class pair{
        int ff;
        int ss;
        pair(int ff,int ss){
            this.ff=ff;
            this.ss=ss;
        }
    }
    

    static int BS(int[] arr, int l, int r, int element) {
        int low = l;
        int high = r;
        while (high - low > 1) {
            int mid = low + (high - low) / 2;
            if (arr[mid] < element) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        if (arr[low] == element) {
            return low;
        } else if (arr[high] == element) {
            return high;
        }
        return -1;
    }

    static int lower_bound(int[] arr, int l, int r, int element) {
        int low = l;
        int high = r;
        while (high - low > 1) {
            int mid = low + (high - low) / 2;
            if (arr[mid] < element) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        if (arr[low] >= element) {
            return low;
        } else if (arr[high] >= element) {
            return high;
        }
        return -1;
    }

    static int upper_bound(int[] arr, int l, int r, int element) {
        int low = l;
        int high = r;
        while (high - low > 1) {
            int mid = low + (high - low) / 2;
            if (arr[mid] <= element) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        if (arr[low] > element) {
            return low;
        } else if (arr[high] > element) {
            return high;
        }
        return -1;
    }
    public static long gcd_long(long a,long b){
        //a/b,a-> dividant b-> divisor
        if(b==0)return a;
        return gcd_long(b, a%b);
    }
    public static int gcd_int(int a,int b){
        //a/b,a-> dividant b-> divisor
        if(b==0)return a;
        return gcd_int(b, a%b);
    }
    public static int lcm(int a,int b){
        int gcd=gcd_int(a, b);
        return (a*b)/gcd;
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

        Long nextLong() {
            return Long.parseLong(next());
        }
    }
}

/*
 * public static boolean lie(int n,int m,int k){ if(n==1 && m==1 && k==0){
 * return true; } if(n<1 || m<1 || k<0){ return false; } boolean
 * tc=lie(n-1,m,k-m); boolean lc=lie(n,m-1,k-n); if(tc || lc){ return true; }
 * return false; }
 */

