This problem is different from the hard version. In this version Ujan makes exactly one exchange. You can hack this problem only if you solve both problems.

After struggling and failing many times, Ujan decided to try to clean up his house again. He decided to get his strings in order first.

Ujan has two distinct strings s and t of length n consisting of only of lowercase English characters. He wants to make them equal. Since Ujan is lazy, he will perform the following operation exactly once: he takes two positions i and j (1 ≤ i,j ≤ n, the values i and j can be equal or different), and swaps the characters s_i and t_j. Can he succeed?

Note that he has to perform this operation exactly once. He has to perform this operation.

Input

The first line contains a single integer k (1 ≤ k ≤ 10), the number of test cases.

For each of the test cases, the first line contains a single integer n (2 ≤ n ≤ 10^4), the length of the strings s and t. 

Each of the next two lines contains the strings s and t, each having length exactly n. The strings consist only of lowercase English letters. It is guaranteed that strings are different.

Output

For each test case, output "Yes" if Ujan can make the two strings equal and "No" otherwise.

You can print each letter in any case (upper or lower).

Example

Input


4
5
souse
houhe
3
cat
dog
2
aa
az
3
abc
bca


Output


Yes
No
No
No

Note

In the first test case, Ujan can swap characters s_1 and t_4, obtaining the word "house".

In the second test case, it is not possible to make the strings equal using exactly one swap of s_i and t_j.
import javafx.util.Pair;

import java.util.*;
import java.io.*;
//Captain on duty!



public class Main {

    static void compare(Main.pair a[] , int n) {

        Arrays.sort(a, new Comparator<Main.pair>() {
            @Override
            public int compare(Main.pair p1, Main.pair p2) {
                return p1.f - p2.f;
            }
        });
    }
    public static boolean checkPalindrome(String s)
    {
        // reverse the given String
        String reverse = new StringBuffer(s).reverse().toString();

        // check whether the string is palindrome or not
        if (s.equals(reverse))
            return true;

        else
            return false;
    }

    static class pair implements Comparable
    {
        int f;
        int s;
        pair(int fi, int se)
        {
            f=fi;
            s=se;
        }
        public int compareTo(Object o)//desc order
        {
            pair pr=(pair)o;
            if(s>pr.s)
                return -1;
            if(s==pr.s)
            {
                if(f>pr.f)
                    return 1;
                else
                    return -1;
            }
            else
                return 1;
        }
        public boolean equals(Object o)
        {
            pair ob=(pair)o;
            if(o!=null)
            {
                if((ob.f==this.f)&&(ob.s==this.s))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s).hashCode();
        }


    }

    public static boolean palin(int l, int r, char[] c) {
        while (l <= r) {
            if (c[l] != c[r]) return false;
            l++;
            r--;
        }
        return true;
    }


    public static long gcd(long a, long b)
    {
        if(b==0)
            return a;

        return gcd(b, a%b);
    }

    public static long hcf(long a, long b)
    {
        long t;
        while(b != 0)
        {
            t = b;
            b = a%b;
            a = t;
        }
        return a;
    }

    public static boolean isPrime(int n)
    {
        if (n <= 1)
            return false;

        // Check from 2 to n-1
        for (int i = 2; i < n; i++)
            if (n % i == 0)
                return false;

        return true;
    }

    public static String reverse(String str)
    {
        String str1="";
        for(int i=0;i<str.length();i++)
        {
            str1 = str1 + str.charAt(str.length()-i-1);
        }
        return str1;
    }



    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

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


    }


    public static void main(String[] args) {
        FastReader s = new FastReader();


        int t=s.nextInt();
        while(t-->0)
        {
            int n=s.nextInt();
            String str1 = s.next();
            String str2 = s.next();
            if(str1.equals(str2))
                System.out.println("YES");
            else
            {
                HashMap<Character,Integer> h=new HashMap<>();
                for(char x='a';x<='z';x++)
                    h.put(x,0);
                for(int i=0;i<n;i++)
                {
                    int temp = h.get(str1.charAt(i));
                    temp++;
                    h.put(str1.charAt(i),temp);
                }

                for(int i=0;i<n;i++)
                {
                    int temp = h.get(str2.charAt(i));
                    temp++;
                    h.put(str2.charAt(i),temp);
                }
                boolean f=false;
                for(char x='a';x<='z';x++)
                {
                    if(h.get(x)%2!=0)
                    {
                        f=true;
                        break;
                    }
                }
                if(f)
                    System.out.println("NO");
                else
                {
                    System.out.println("YES");
                    HashMap<Integer, pair> h1=new HashMap<>();
                    char[] c1=str1.toCharArray();
                    char[] c2=str2.toCharArray();
                    int c=0;
                    for(int i=0;i<n;i++) {

                        if (c1[i] != c2[i]) {
                            char x = c1[i];
                            int id = -1;
                            for (int j = 0; j < n; j++) {
                                if (c2[j] == x && c1[j]!=x) {
                                    id = j;
                                    break;
                                }
                            }
                            //System.out.println(id + " "+i);
                            if (id != -1) {
                                pair p1;
                                h1.put(c, p1 = new pair(id, id));
                                char temp = c1[id];
                                c1[id] = c2[id];
                                c2[id] = temp;
                                c++;
                                h1.put(c, p1 = new pair(id, i));
                                temp = c1[id];
                                c1[id] = c2[i];
                                c2[i] = temp;
                                c++;
                                //System.out.println(id + " "+i);
                            } else {

                                for (int k = i + 1; k < n; k++) {
                                    if (c1[k] == x) {
                                        id = k;
                                        break;
                                    }
                                }
                                //System.out.println(id + " "+i);

                                pair p1;
                                h1.put(c, p1 = new pair(id, i));
                                char temp;
                                temp = c1[id];
                                c1[id] = c2[i];
                                c2[i] = temp;
                                c++;

                            }
                        }
                    }

                    System.out.println(h1.size());
                    for(int i=0;i<h1.size();i++)
                    {
                        pair p=h1.get(i);
                        System.out.println((p.f+1)  + " "+ (p.s+1));
                    }

                }
            }
        }




    }


}








