You are given two strings s and t. Both strings have length n and consist of lowercase Latin letters. The characters in the strings are numbered from 1 to n.

You can successively perform the following move any number of times (possibly, zero):

  * swap any two adjacent (neighboring) characters of s (i.e. for any i = \{1, 2, ..., n - 1\} you can swap s_i and s_{i + 1}). 



You can't apply a move to the string t. The moves are applied to the string s one after another.

Your task is to obtain the string t from the string s. Find any way to do it with at most 10^4 such moves.

You do not have to minimize the number of moves, just find any sequence of moves of length 10^4 or less to transform s into t.

Input

The first line of the input contains one integer n (1 ≤ n ≤ 50) — the length of strings s and t.

The second line of the input contains the string s consisting of n lowercase Latin letters.

The third line of the input contains the string t consisting of n lowercase Latin letters.

Output

If it is impossible to obtain the string t using moves, print "-1".

Otherwise in the first line print one integer k — the number of moves to transform s to t. Note that k must be an integer number between 0 and 10^4 inclusive.

In the second line print k integers c_j (1 ≤ c_j < n), where c_j means that on the j-th move you swap characters s_{c_j} and s_{c_j + 1}.

If you do not need to apply any moves, print a single integer 0 in the first line and either leave the second line empty or do not print it at all.

Examples

Input

6
abcdef
abdfec


Output

4
3 5 4 5 


Input

4
abcd
accd


Output

-1

Note

In the first example the string s changes as follows: "abcdef" → "abdcef" → "abdcfe" → "abdfce" → "abdfec".

In the second example there is no way to transform the string s into the string t through any allowed moves.
//Author: Mo Abjal, MJP Rohilkhand University Bareilly, UP, India 2018.
///////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////********************//////////////////////////////////////////////
/////////////////////////////////////////*     SOLUTION     *//////////////////////////////////////////////
/////////////////////////////////////////********************//////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////
import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
public class Main{
	public static StringTokenizer token = new StringTokenizer("");
	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static PrintWriter output = new PrintWriter(System.out);
	public static void main(String[] afzal) throws Exception {	
		int N = ni();
		String s = ns();
		String t = ns();
		char T[] = t.toCharArray();
		char S[] = s.toCharArray();
		char A[] = s.toCharArray();
		char B[] = t.toCharArray();
		int i=0,count=0;
		Arrays.sort(A);
		Arrays.sort(B);
		if(!(new String(A).equals(new String(B)))){
			output.println(-1); output.close(); return;
		}
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(i<N-1){
			int pos = 0;
			if(S[i]!=T[i]){
				for(int j=i;j<N;j++){
					if(S[j]==T[i]){						
						pos = j; break;
					}
				}
				list.add(pos);//System.out.println(pos);
				char temp = S[pos];
				S[pos] = S[pos-1];
				S[pos-1] = temp; count=0; i=0;
			}
			else{
				i++;
				count++; if(count==N) break;
			}
			
		}
		output.println(list.size());
		for(Integer print:list) output.print(print+" "); output.close();
		/*int N = ni();
		int A[] = new int[63];
		int index=0;
		for(int i=1;i<1000000;i++){
			int x = i;
			boolean flag = true;
			while(x>0){
				if(x%10==1 || x%10==0);
				else{
					flag=false; break;
				}
				x/=10;
			}
			if(flag){
				A[index++] = i;
			}
		}
		index--; int count=0;
		ArrayList<Integer> list = new ArrayList<Integer>();
		while(N>0){
			if(N>=A[index]){
				list.add(A[index]);
				N-=A[index];
				count++;
			}
			else{
				index--;
			}
		}
		output.println(count);
		for(Integer i:list) output.print(i+" ");
		output.close();
		/*int A = ni();
		int B = ni();
		int C = ni();
		String ans = "";
		if(C>=A || C>=B)
		if(C%A==0){
			ans = "YES";
		}
		else if(C%B==0){
			ans = "YES";
		}
		else if((C-A)%B==0){
			ans = "YES";
		}
		else if((C-B)%A==0){
			ans = "YES";
		}
		else{
			ans = "NO";
		}
		else ans = "NO";
		output.println(ans); output.close();*/
		/*int N = ni();
		for(int i=0;i<N;i++){
			int count=0;
			int L = ni();
			int v = ni();
			int l = ni();
			int r = ni();
			if(1%v==0) count++;
			if(l%v==0) count++;
			if(r%v==0) count++;
			if(L%v==0) count++;
			count+=l/v;
			count+=(L-r)/v;
			int x = (L-(r-l+1))/v;
			output.println(count);
		}
		output.close();*/
		/*int N = ni();
		boolean flag = true;
		int x = N;
		while(x>0){
			if(x%10==0 || x%10==1){				
			}
			else{
				flag = false; break;
			}
			x/=10;
		}
		if(flag){
			output.println("1\n"+N); output.close(); return;
		}
		String temp = "";
		int count = 1;
		for(int i=0;count<=ps(N).length();i++){
			temp+="1"; count++;
		}
		if(temp=="") temp="1";
		int test = pi(temp);

		int ans=0;
		int A[] = new int[N+5];
		int j=0;
		//output.println(test);
		while(N>0){
			if(N>=test){
				A[j] = test; N-=test; ans++;
				j++;
				//System.out.println(A[j]+" ");
			}
			else if(test%10==0 && (test/10)%10==1){
				test-=9;
			}
			else if(test%10==1 && (test/10)%10==0){
				test-=90;
			}
			else if(test%10==1 && (test/10)%10==1){
				test--;
			}
			
		}
		output.println(ans);
		for(int i=0;A[i+1]!=0;i++){
			output.print(A[i]+" ");
		}
		output.println(test); output.close();*/
	}
	public static String pc(char c){
		return Character.toString(c);
	} 
	public static Integer pci(char c){
		return pi(Character.toString(c));
	}
	public static Integer pi(String str){
		return Integer.parseInt(str);
	}
	public static Long pl(String str){
		return Long.parseLong(str);
	}
	public static String ps(Integer N){
		return Integer.toString(N);
	}
	public static char[] pcc(String str){
		return str.toCharArray();
	}
	public static Integer ni() throws IOException{
		if(!token.hasMoreElements()){
			token = new StringTokenizer(br.readLine());
		}
		return Integer.parseInt(token.nextToken());
	}
	public static Long nl() throws IOException{
		if(!token.hasMoreElements()){
			token = new StringTokenizer(br.readLine());
		}
		return Long.parseLong(token.nextToken());
	}
	public static Double nd() throws IOException{
		if(!token.hasMoreElements()){
			token = new StringTokenizer(br.readLine());
		}
		return Double.parseDouble(token.nextToken());
	}
	public static String ns() throws IOException{
		return new StringTokenizer(br.readLine()).nextToken();
	}
	public static Integer[] ai(int N) throws IOException{
		Integer A[] = new Integer[N];
		token = new StringTokenizer(br.readLine());
		for(int i=0;i<A.length;i++){
			A[i] = pi(token.nextToken());
		}
		return A;
	}
	public static long[] al(int N) throws IOException{
		long A[] = new long[N];
		token = new StringTokenizer(br.readLine());
		for(int i=0;i<N;i++){
			A[i] = Long.parseLong(token.nextToken());
		}
		return A;
	}
	public static char[][] acc(int N,int M) throws IOException{
		char C[][] = new char[N][M];
		for(int i=0;i<N;i++){
			token = new StringTokenizer(br.readLine());
			String s = token.nextToken();
			for(int j=0;j<M;j++){
				C[i][j] = s.charAt(j);
			}
		}
		return C;
	}
	public static String[] as(int N) throws IOException{
		String S[] = new String[N];
		token = new StringTokenizer(br.readLine());
		for(int i=0;i<S.length;i++){
			S[i] = token.nextToken();
		}
		return S;
	}

	public static long fact(long N){
		long fact = 1;
		for(int i=1;i<=N;i++){
			fact = fact * i;
		}
		return fact;
	}
	public static BigInteger factB(int N){
		BigInteger b = new BigInteger("1");
		for(int i=1;i<=N;i++){
			b = b.multiply(BigInteger.valueOf(i));
		}
		return b;
	}
	public static long sod(long N){
		long sum = 0;
		while(N>0){
			long x = N%10;
			sum = sum + x;
			N = N/10;
		}
		return sum;
	}
	public static Integer cd(long N){
		int count=0;
		while(N>0){
			N = N/10; count++;
		}
		return count=0;
	}
}
class Pair implements Comparable{
	int a,b;
	public Pair(int a,int b){
		this.a = a;
		this.b = b;
	}
	public int compareTo(Object p){
		Pair pa = (Pair)p;
		if(this.a==pa.a) return this.b - pa.b;
		return this.a - pa.a;
	} 
}
//Copyright Reserved - Mo Abjal.

/*

import java.util.Arrays;
import java.util.Scanner;
public class MockvitD {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int d=sc.nextInt();
		Boss[]a=new Boss[n];
		for(int i=0;i<n;i++){
			a[i]=new Boss(sc.nextInt(),sc.nextInt());
		}
		Arrays.sort(a);
		int i=0,j=0;
		long sum=0,ans=-1l;
		for(i=0;i<n;i++){
			sum=sum+a[i].f;
			if(a[i].m-a[j].m>=d){
				sum=sum-a[j].f;
				j++;
			}
			ans=Math.max(sum,ans);
		}
		System.out.println(ans);
	}
}*/