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 java.io.*;
import java.math.BigInteger;
import java.util.*;

// written by luchy0120

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

        new Main().run();
    }



    class Pair{
        int x;int y;
        Pair(int x,int y){this.x = x;this.y = y;}

        @Override
        public int hashCode(){
            return x*127+y;
        }

        @Override
        public boolean equals(Object obj){
            Pair pr = (Pair)obj;
            return pr.x == x && pr.y == y;
        }
    }


    int h[],to[],ne[],wt[];
    int ct = 0;

    void add(int u,int v,int w){
        to[ct] = v;
      //  wt[ct] = w;
        ne[ct] = h[u];
        h[u] = ct++;
    }


    long gcd(long a,long b){
        return b==0?a:gcd(b,a%b);
    }




    static int MAXN = 100000;
    static long tree[];

    void update(int i,long v){
        while(i<tree.length){
            tree[i] += v;
            i += i&(-i);
        }
    }

    long sum(int i){
        long v = 0;
        while(i>0){
            v = v + tree[i];
            i -= i&(-i);
        }
        return v;
    }


    boolean isshun(int put[]){
        int len = put.length;
        if(put[len-1]==14) return false;
        if(put[0]==2) return false;
        if(put[1]==2) return false;
        for(int i=1;i<len;++i){
            if(put[i]-put[i-1]!=1) return false;
        }
        return true;
    }

    boolean doubleshun(int put[]){
        int len = put.length;
        if(len%2==1) return false;
        for(int i=1;i<len;i+=2){
            if(put[i]-put[i-1]!=0) return false;
        }
        for(int i=2;i<len;i+=2){
            if(put[i]-put[i-1]!=1) return false;
        }
        return true;
    }

    TreeMap<Integer,Integer> mp = new TreeMap<>();
    int sz1 = 0;
    void insert(int v){
        sz1++;
        mp.put(v,mp.getOrDefault(v,0)+1);
    }

    void remove(int v){
        int ct = mp.getOrDefault(v,0);
        if(ct==0) return;
        sz1--;
        if(ct==1){
            mp.remove(v);
        }else{
            mp.put(v,ct-1);
        }
    }

    int front(){
        return mp.firstKey();
    }


    void solve(){
//        int s = ni();
//        int n = ni();
//
//        long x[] = new long[n];
//        long y[] = new long[n];
//        for(int i=0;i<n;++i){
//            x[i] = nl();
//            y[i] = nl();
//        }
//
//
//        int m = n*(n-1)/2;
//
//        long egs[][] = new long[m][3];
//        int g = 0;
//        init(n);
//        for(int i=0;i<n;++i){
//            for(int j=i+1;j<n;++j){
//                egs[g][0] = (x[i]-x[j])*(x[i]-x[j])+ (y[i]-y[j])*(y[i]-y[j]);
//                egs[g][1] = i;
//                egs[g][2] = j;g++;
//            }
//        }
//        double r = 0;
//
//        Arrays.sort(egs, new Comparator<long[]>() {
//            @Override
//            public int compare(long[] xx, long[] yy) {
//                return Long.compare(xx[0],yy[0]);
//            }
//        });
//        for(int i=0;i<m;++i){
//            int u = (int)egs[i][1];
//            int v = (int)egs[i][2];
//            if(root(u)!=root(v)){
//                combine(u,v);
//                r = Math.sqrt(egs[i][0]);
//                if(groups==s){
//                    break;
//                }
//            }
//        }
//        println(roundS(r,2));


      int t = ni();

      ot:for(int i=0;i<t;++i){
          int n = ni();
          char[] a = ns().toCharArray();
          char[] b = ns().toCharArray();
          int d[] = new int[26];

          for(char c:a){
              d[c-'a']++;
          }
          for(char c:b){
              d[c-'a']++;
          }

          for(int j=0;j<26;++j){
              if(d[j]%2!=0){
                  println("No");
                  continue ot;
              }
          }



              List<int[]> li =new ArrayList<>();
              for(int j=0;j<a.length;++j){
                  if(a[j]!=b[j]){

                      for(int g=j+1;g<a.length;++g){
                          if(b[g]==a[j]){
                                li.add(new int[]{g+1,g+1});
                                li.add(new int[]{g+1,j+1});
                                b[g] = a[g];
                                a[g] = b[j];
                                break;
                          }else if(a[g]==a[j]){
                                li.add(new int[]{g+1,j+1});
                                a[g] = b[j];
                                break;
                          }
                      }

                  }
              }
              println("Yes");
              println(li.size());
              for(int j=0;j<li.size();++j){
                  println(li.get(j)[0]+" "+li.get(j)[1]);
              }






      }












    }

    static int groups = 0;
    static int[] fa;
    static int[] sz;

    static void init(int n) {
        groups = n;
        fa = new int[n];
        for (int i = 1; i < n; ++i) {
            fa[i] = i;
        }
        sz = new int[n];
        Arrays.fill(sz, 1);
    }

    static int root(int p) {
        while (p != fa[p]) {
            fa[p] = fa[fa[p]];
            p = fa[p];
        }
        return p;
    }

    static void combine(int p, int q) {
        int i = root(p);
        int j = root(q);
        if (i == j) {
            return;
        }
        if (sz[i] < sz[j]) {
            fa[i] = j;
            sz[j] += sz[i];
        } else {
            fa[j] = i;
            sz[i] += sz[j];
        }
        groups--;
    }

    public static String roundS(double result, int scale){
        String fmt = String.format("%%.%df", scale);
        return String.format(fmt, result);
    }








//    void solve() {
//
//        for(int i=0;i<9;++i) {
//            for (int j = 0; j < 9; ++j) {
//                int v = ni();
//                a[i][j] = v;
//                if(v>0) {
//                    vis_row[i][v] = true;
//                    vis_col[j][v] = true;
//                    vis_room[get_room(i, j)][v] = true;
//                }else{
//                    space++;
//                }
//            }
//        }
//
//
//        prepare = new int[space][2];
//
//        int p = 0;
//
//        for(int i=0;i<9;++i) {
//            for (int j = 0; j < 9; ++j) {
//                if(a[i][j]==0){
//                    prepare[p][0] = i;
//                    prepare[p][1]= j;p++;
//                    List<Integer> temp =new ArrayList<>();
//                    for(int k=1;k<=9;++k){
//                        if(!vis_col[j][k]&&!vis_row[i][k]&&!vis_room[get_room(i,j)][k]){
//                            temp.add(k);
//                        }
//                    }
//                    int sz = temp.size();
//                    val[i][j] = new int[sz];
//                    for(int k=0;k<sz;++k){
//                        val[i][j][k] = temp.get(k);
//                    }
//                }
//            }
//        }
//        Arrays.sort(prepare,(x,y)->{
//           return Integer.compare(val[x[0]][x[1]].length,val[y[0]][y[1]].length);
//        });
//        dfs(0);
//
//
//
//
//
//
//
//
//
//
//    }




    InputStream is;
    PrintWriter out;

    void run() throws Exception {
        is = System.in;
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private char ncc() {
        int b = readByte();
        return (char) b;
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private String nline() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!isSpaceChar(b) || b == ' ') {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[][] nm(int n, int m) {
        char[][] a = new char[n][];
        for (int i = 0; i < n; i++) a[i] = ns(m);
        return a;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private long[] nal(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nl();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = (num << 3) + (num << 1) + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = num * 10 + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    void print(Object obj) {
        out.print(obj);
    }

    void println(Object obj) {
        out.println(obj);
    }

    void println() {
        out.println();
    }

    void printArray(int a[],int from){
        int l = a.length;
        for(int i=from;i<l;++i){
            print(a[i]);
            if(i!=l-1){
                print(" ");
            }
        }
        println();
    }

    void printArray(long a[],int from){
        int l = a.length;
        for(int i=from;i<l;++i){
            print(a[i]);
            if(i!=l-1){
                print(" ");
            }
        }
        println();
    }
}