A number is ternary if it contains only digits 0, 1 and 2. For example, the following numbers are ternary: 1022, 11, 21, 2002.

You are given a long ternary number x. The first (leftmost) digit of x is guaranteed to be 2, the other digits of x can be 0, 1 or 2.

Let's define the ternary XOR operation ⊙ of two ternary numbers a and b (both of length n) as a number c = a ⊙ b of length n, where c_i = (a_i + b_i) \% 3 (where \% is modulo operation). In other words, add the corresponding digits and take the remainders of the sums when divided by 3. For example, 10222 ⊙ 11021 = 21210.

Your task is to find such ternary numbers a and b both of length n and both without leading zeros that a ⊙ b = x and max(a, b) is the minimum possible.

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases. Then t test cases follow. The first line of the test case contains one integer n (1 ≤ n ≤ 5 ⋅ 10^4) — the length of x. The second line of the test case contains ternary number x consisting of n digits 0, 1 or 2. It is guaranteed that the first digit of x is 2. It is guaranteed that the sum of n over all test cases does not exceed 5 ⋅ 10^4 (∑ n ≤ 5 ⋅ 10^4).

Output

For each test case, print the answer — two ternary integers a and b both of length n and both without leading zeros such that a ⊙ b = x and max(a, b) is the minimum possible. If there are several answers, you can print any.

Example

Input


4
5
22222
5
21211
1
2
9
220222021


Output


11111
11111
11000
10211
1
1
110111011
110111010
import javax.swing.text.AbstractDocument;
import java.io.*;
import java.lang.reflect.Type;
import java.util.*;

import static java.lang.Math.*;

public class tryyy implements Comparable {
    @Override
    public int compareTo(Object s) {
        return 0;
    }

    static public class pair {
        int u;
        int idx;
        int val;

        public pair(int x, int i) {
            u = x;
            idx = i;
            val = -1;
        }
    }


    static ArrayList<Integer>[] adj;
    static int[] value, weight, Arr;
    static long inf = (long) 1e16;
    static int n, m;

    static boolean[][] matrix;
    static double[][] memo;
    static long mod = (long) (1e9 + 7);

    public static boolean sub(String a, String b) {
        for (int i = 0; i < a.length(); i++) {
            if (a.charAt(i) == b.charAt(i) || a.charAt(i) == '?' || b.charAt(i) == '?')
                continue;
            return false;
        }
        return true;
    }

    public static boolean cont(String a, String b) {
        int n = b.length();
        for (int i = 0; i < a.length() - n; i++) {
            if (sub(a.substring(i, i + n), b))
                return true;
        }
        return false;
    }

    public static int inter(String a, String b) {
        int n = min(a.length(), b.length());
        if (cont(a, b) || cont(b, a))
            return n;
        while (n > 0) {
            if (sub(a.substring(a.length() - n), (b.substring(0, n))))
                return n;
            n--;
        }
        return 0;
    }

    static TreeSet<String> ts;

    public static void backtrack(int idx, int upperBound, String str) {
        if (idx == n) {
            ts.add(str);
            return;
        }
        for (int i = 0; i <= upperBound + 1; i++) {
            backtrack(idx + 1, Math.max(upperBound, i), str + (char) ('a' + i));
        }
    }

    static int w, maxvalue = 2;
    static double[] prob;
    static double mem[][][];
    static int[][][] memm;

    public static double dp(int one, int two, int three) {
        if (one == 0 && two == 0 && three == 0) return 0;
        if (mem[one][two][three] > -0.5) return mem[one][two][three];
        double ans = 0;
        double d = (n * 1d) / (one + two + three);
        int c = 0;
        if (three > 0) {
            ans += (d + dp(one, two + 1, three - 1));
            c++;
        }
        if (two > 0) {
            ans += (d + dp(one + 1, two - 1, three));
            c++;
        }
        if (one > 0) {
            ans += (d + dp(one - 1, two, three));
            c++;
        }
        return mem[one][two][three] = ans / c;
    }

    public static int count(int one, int two, int three) {
        if (one == 0 && two == 0 && three == 0) return 1;
        if (memm[one][two][three] != -1) return memm[one][two][three];
        int ans = 0;
        if (three > 0)
            ans += count(one, two + 1, three - 1);
        if (two > 0)
            ans += count(one + 1, two - 1, three);
        if (one > 0)
            ans += count(one - 1, two, three);
        return memm[one][two][three] = ans;
    }

    static PrintWriter pw;


    static int[] dp;


    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            char[] Arr = sc.next().toCharArray();
            int[] Arr1 = new int[n];
            int[] Arr2 = new int[n];
            int equal = 0;

            for (int i = 0; i < n; i++) {
                if (i == 0 && Arr[0] == '0') {
                    Arr1[0] = 2;
                    Arr2[0] = 1;
                    equal = 2;
                } else {
                    if (Arr[i] == '1') {
                        if ( equal == 0) {
                            Arr1[i] = 1;
                            equal = 2;
                        } else if(equal==2){
                            Arr2[i] = 1;
                        }else{
                            Arr1[i]=1;
                        }

                    } else if (Arr[i] == '2') {
                        if (equal == 0) {
                            Arr1[i] = 1;
                            Arr2[i] = 1;
                        } else if (equal == 1) {
                            Arr1[i] = 2;
                        } else {
                            Arr2[i] = 2;
                        }
                    }
                }
            }
            for (int x : Arr1)
                pw.print(x);
            pw.println();
            for (int x : Arr2)
                pw.print(x);
            pw.println();
        }
        pw.close();
    }

    public static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(s));

        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException, IOException {
            return br.ready();
        }

    }
}
