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


public class GFGMs
{
    static int mod1=(int)(1e9+7);
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
        public int[] nextArray(int n) throws IOException
        {
            int[] a=new int[n];
            for(int i=0;i<n;i++)
            {
                a[i]=nextInt();
            }
            return a;
        }
    }

    static boolean primeCheck(int num0)
    {
        boolean b1=true;
        int num01=(int)(Math.sqrt(num0))+1;
        me1: for(int m=2;m<num01;m++)
        {
            if(num0%m==0)
            {
                b1=false;
                break me1;
            }
        }
        if(num0==1 || num0==0)
        {
            b1=false;
        }
        return b1;
    }
    static long pow1(long x, long y, long p)
    {
        // Initialize result
        long res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }


    static int find(int pos1,char chr1,String str0)
    {
        int num5=-1;
        int len0=str0.length();
        me0: for(int i=pos1;i<len0;i++)
        {
            if(str0.charAt(i)==chr1)
            {
                num5=i;
                break me0;
            }
        }
        return num5;
    }
    static int gcd(int a, int b)
    {
        if (a == 0 || b == 0)
            return 0;
        if (a == b)
            return a;
        if (a > b)
            return gcd(a-b, b);
        return gcd(a, b-a);
    }
    static void insertionSort(int arr[], int n)
    {
        int i, key, j;
        for (i = 1; i < n; i++)
        {
            key = arr[i];
            j = i-1;

            while (j >= 0 && arr[j] > key)
            {
                arr[j+1] = arr[j];
                j = j-1;
            }
            arr[j+1] = key;
            print(arr,n);
        }
    }
    static void print(int arr[], int n)
    {
        for (int i=0; i < n; i++)
        {
            System.out.print(arr[i] + " ");
        }
        System.out.println();
    }
    static String[] equality(char[] chr3,char[] chr5,int pos0,int len0,String str0,int count0)
    {
        char chr0=chr5[pos0];
        int pos1=0;
        me1: for(int i=pos0;i<len0;i++)
        {
            if(chr3[i]==chr0)
            {
                pos1=i;
                break me1;
            }
        }
        while(pos1>0 && chr3[pos0]!=chr0)
        {
            str0=str0+pos1+" ";
            char chr11=chr3[pos1];
            chr3[pos1]=chr3[pos1-1];
            chr3[pos1-1]=chr11;
            count0=count0+1;
            pos1=pos1-1;
        }
        String[] strarr1={str0,String.valueOf(count0)};
        return strarr1;
    }
    public static void main(String[] args) throws IOException
    {
        Scanner s=new Scanner(System.in);
        OutputWriter out1=new OutputWriter(System.out);
        int num1=s.nextInt();
        String str1=s.next();
        char[] chr1=str1.toCharArray();
        char[] chr01=str1.toCharArray();
        String str2=s.next();
        char[] chr2=str2.toCharArray();
        char[] chr02=str2.toCharArray();
        Arrays.sort(chr01);
        Arrays.sort(chr02);
        String ans1="";
        int count1=0;
        if(Arrays.equals(chr01,chr02))
        {
            for (int i = 0; i < num1; i++)
            {
                if (chr1[i] != chr2[i])
                {
                    String[] strarr2=equality(chr1, chr2, i, num1, ans1, count1);
                    ans1=strarr2[0];
                    count1=Integer.parseInt(strarr2[1]);
                }
            }
            out1.print(count1 + "\n");
            out1.print(ans1+"");
        }
        else
        {
            out1.print(-1+"");
        }
        out1.close();
    }
}

class OutputWriter{
    BufferedWriter writer;

    public OutputWriter(OutputStream stream){
        writer = new BufferedWriter(new OutputStreamWriter(stream));
    }

    public void print(int i) throws IOException {
        writer.write(i);
    }

    public void print(String s) throws IOException {
        writer.write(s);
    }

    public void print(char []c) throws IOException {
        writer.write(c);
    }
    public  void close() throws IOException {
        writer.close();
    }
}
