You are given the strings a and b, consisting of lowercase Latin letters. You can do any number of the following operations in any order: 

  * if |a| > 0 (the length of the string a is greater than zero), delete the first character of the string a, that is, replace a with a_2 a_3 … a_n; 
  * if |a| > 0, delete the last character of the string a, that is, replace a with a_1 a_2 … a_{n-1}; 
  * if |b| > 0 (the length of the string b is greater than zero), delete the first character of the string b, that is, replace b with b_2 b_3 … b_n; 
  * if |b| > 0, delete the last character of the string b, that is, replace b with b_1 b_2 … b_{n-1}. 



Note that after each of the operations, the string a or b may become empty.

For example, if a="hello" and b="icpc", then you can apply the following sequence of operations: 

  * delete the first character of the string a ⇒ a="ello" and b="icpc"; 
  * delete the first character of the string b ⇒ a="ello" and b="cpc"; 
  * delete the first character of the string b ⇒ a="ello" and b="pc"; 
  * delete the last character of the string a ⇒ a="ell" and b="pc"; 
  * delete the last character of the string b ⇒ a="ell" and b="p". 



For the given strings a and b, find the minimum number of operations for which you can make the strings a and b equal. Note that empty strings are also equal.

Input

The first line contains a single integer t (1 ≤ t ≤ 100). Then t test cases follow.

The first line of each test case contains the string a (1 ≤ |a| ≤ 20), consisting of lowercase Latin letters.

The second line of each test case contains the string b (1 ≤ |b| ≤ 20), consisting of lowercase Latin letters.

Output

For each test case, output the minimum number of operations that can make the strings a and b equal.

Example

Input


5
a
a
abcd
bc
hello
codeforces
hello
helo
dhjakjsnasjhfksafasd
adjsnasjhfksvdafdser


Output


0
2
13
3
20
import java.io.*;
import java.util.*;
import java.util.StringTokenizer;


public class Main {
    //    static Integer[][] tokens;
//    static HashMap<String , Integer> hashMap;
    static boolean[][] visited;
    public static void main(String[] args) throws IOException {
//        InputReader sc = new InputReader(System.in);
//        PrintWriter out = new PrintWriter(System.out);

        FastReader reader = new FastReader();
        int test = reader.nextInt();
        for (int o = 1; o <= test; o++) {
            String a = reader.next();
            String b = reader.next();
            boolean[][] ma = new boolean[a.length()][a.length()];
            int gap  = -1;
            for (int i = 0; i < a.length(); i++){
                for (int j = i ; j <= a.length(); j++){
                    if (b.contains(a.substring(i, j))){ gap = Math.max(gap, j - i);}
                }
            }
            //System.out.println(gap);
            int k = a.length() + b.length() - gap - gap;
            System.out.println(k);
        }
        System.out.close();
    }

}








class Node {
    int a; int b; int d; int end_time; int starttime;
    public Node(int a, int b, int d){
        this.a = a; this.b = b;
    }
}








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());
    }

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

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

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

/** Class for buffered reading int and double values */
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

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

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

 class InputReader {
    private final int BUFFER_SIZE = 32768;
    private InputStream stream;
    private byte[] buffer = new byte[BUFFER_SIZE + 1];
    private int pointer = 1;
    private int readLength = 0;
    private int lastWhiteSpace = '\n';

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private void fillBuffer() {
        try {
            readLength = stream.read(buffer, 1, BUFFER_SIZE);
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    private byte get() {
        if (pointer > readLength) {
            pointer = 1;
            fillBuffer();
            if (readLength <= 0) return -1;
        }
        return buffer[pointer++];
    }

    private byte peek() {
        if (pointer > readLength) {
            pointer = 1;
            fillBuffer();
            if (readLength <= 0) return -1;
        }
        return buffer[pointer];
    }

    public boolean hasNext() {
        int c;
        while (isWhiteSpace(c = peek()) && c != -1) {
            get();
        }
        return c != -1;
    }

    public char nextChar() {
        int c = get();

        while (isWhiteSpace(c)) {
            c = get();
        }

        return (char) c;
    }

    public int nextInt() {
        int c = nextChar();
        int sign = 1;

        if (c == '-') {
            sign = -1;
            c = get();
        }

        int abs = 0;

        do {
            if (c < '0' || c > '9') throw new InputMismatchException();
            abs *= 10;
            abs += c - '0';
            c = get();
        } while (!isWhiteSpace(c));

        lastWhiteSpace = c;

        return abs * sign;
    }

    public long nextLong() {
        int c = nextChar();
        long sign = 1;

        if (c == '-') {
            sign = -1;
            c = get();
        }

        long abs = 0;

        do {
            if (c < '0' || c > '9') throw new InputMismatchException();
            abs *= 10;
            abs += c - '0';
            c = get();
        } while (!isWhiteSpace(c));

        lastWhiteSpace = c;

        return abs * sign;
    }

    public double nextDouble() {
        int c = nextChar();
        int sign = 1;

        if (c == '-') {
            sign = -1;
            c = get();
        }

        double abs = 0;

        do {
            abs = (c - '0') + abs * 10;
        } while (!isWhiteSpace(c) && c != '.');

        if (c == '.') {
            int m = 1;

            do {
                abs = abs + (c - '0') * m;
                m /= 10;
            } while (!isWhiteSpace(c));
        }

        return abs * sign;
    }

    public String nextString() {
        int c = nextChar();

        if (c == -1) return null;

        StringBuilder builder = new StringBuilder();

        do {
            builder.append((char) c);
            c = get();
        } while (!isWhiteSpace(c));

        return builder.toString();
    }

    public String next() {
        return nextString();
    }

    public String nextLine() {
        if (lastWhiteSpace != '\r' && lastWhiteSpace != '\n') throw new InputMismatchException();

        int c = get();

        if (lastWhiteSpace == '\r') {
            if (c == '\n') {
                lastWhiteSpace = '\n';
                c = get();
            }
            else {
                --pointer;
            }
        }

        if (c == -1 || c == '\r' || c == '\n') return null; // empty line

        StringBuilder builder = new StringBuilder();

        do {
            builder.append(c);
            c = get();
        } while (c != '\r' && c != '\n');

        return builder.toString();
    }

    public boolean isWhiteSpace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
}
