C. Help Shahhoud
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Shahhoud is participating in the first Div.3 contest on Codeforces, the first problem was:

Given two strings A and B of equal length N (N is odd), find the minimum number of steps needed to change A into B, or print  - 1 if it's impossible.

In each step, you can choose an odd integer x such that 1 ≤ x ≤ N, and reverse the substring of length x that is centered in the middle of A. For example, performing a step with x = 3 on the string "abcde" results in "adcbe" and applying x = 5 on "abcde" results in "edcba".

Can you help Shahhoud solve the problem?

Input

The first line contains one integer T, the number of test cases.

Each test case consists of two lines, the first contains the string A, and the second contains the string B. (1 ≤ |A| = |B| ≤ 105) |A| = |B| is odd.

Both strings consist of lowercase English letters.

Output

For each test case, print one line containing one integer,  - 1 if A can't be changed into B, or the minimum number of steps to change A into B.

Example
Input
1
abcxdef
fecxdba
Output
2