Problem: Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the problem of discrete logarithm!

Of course, there is a code lock is installed on the safe. The lock has a screen that displays a string of n lowercase Latin letters. Initially, the screen displays string s. Whitfield and Martin found out that the safe will open when string t will be displayed on the screen.

The string on the screen can be changed using the operation «shift x». In order to apply this operation, explorers choose an integer x from 0 to n inclusive. After that, the current string p = αβ changes to βRα, where the length of β is x, and the length of α is n - x. In other words, the suffix of the length x of string p is reversed and moved to the beginning of the string. For example, after the operation «shift 4» the string «abcacb» will be changed with string «bcacab », since α = ab, β = cacb, βR = bcac.

Explorers are afraid that if they apply too many operations «shift», the lock will be locked forever. They ask you to find a way to get the string t on the screen, using no more than 6100 operations.

Input

The first line contains an integer n, the length of the strings s and t (1 ≤ n ≤ 2 000).

After that, there are two strings s and t, consisting of n lowercase Latin letters each.

Output

If it is impossible to get string t from string s using no more than 6100 operations «shift», print a single number  - 1.

Otherwise, in the first line output the number of operations k (0 ≤ k ≤ 6100). In the next line output k numbers xi corresponding to the operations «shift xi» (0 ≤ xi ≤ n) in the order in which they should be applied.

Examples

Input

6
abacbb
babcba


Output

4
6 3 2 3


Input

3
aba
bba


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;
namespace Problem {
using namespace std;
class Writer {
  static ostringstream oss;

 public:
  template <class T>
  void appendln(const vector<vector<T>>& ans, string spl = " ",
                string el = "\n") {
    for (int i = 0; i < (int)ans.size(); ++i) {
      for (int j = 0; j < (int)ans[i].size(); ++j) {
        oss << ans[i][j];
        oss << (j == (int)ans[i].size() - 1 ? el : spl);
      }
    }
  }
  template <class T>
  void appendln(const vector<T>& ans, string spl = " ") {
    for (int i = 0; i < (int)ans.size(); ++i) {
      oss << ans[i] << (i == (int)ans.size() - 1 ? "\n" : spl);
    }
  }
  template <class T>
  void appendln(const T& answer) {
    oss << answer << "\n";
  }
  template <class T>
  void append(const T& answer) {
    oss << answer;
  }
  void appends(const string spl) {
    oss.seekp((int)oss.tellp() - 1);
    oss << "\n";
  }
  template <class F, class... R>
  void appends(const string spl, const F& fi, const R&... rest) {
    oss << fi << spl;
    appends(spl, rest...);
  }
  static void write() { cout << oss.str(); }
  Writer() {
    static bool is_single = true;
    assert(is_single);
    is_single = false;
  };
};
ostringstream Writer::oss;
class Solver {
 public:
  int n, l;
  string s, t;
  vector<int> ans;
  Solver(LL n) : n(n){};
  void solve() {
    cin >> s >> t;
    auto ss = s;
    sort(ss.begin(), ss.end());
    auto tt = t;
    sort(tt.begin(), tt.end());
    if (ss != tt) {
      cout << -1 << "\n";
      return;
    }
    l = (int)s.size();
    for (int i = 0; i < l - 1; i += 2) {
      int x = 0, y = 0;
      for (int j = i; j < n; ++j) {
        if (s[j] == t[i]) {
          x = j;
          break;
        }
      }
      for (int j = i; j < n; ++j) {
        if (s[j] == t[i + 1] and j != x) {
          y = j;
          break;
        }
      };
      if (x < y) {
        int a, b, c, d;
        a = i;
        b = x - i;
        c = y - x - 1;
        d = l - y - 1;
        add(b + c + d + 2);
        add(a + b);
        add(1);
        add(c + 1);
        add(b + d);
        add(l);
      } else {
        int a, b, c, d;
        a = i;
        b = y - i;
        c = x - y - 1;
        d = l - x - 1;
        ;
        add(b + c + d + 2);
        add(a + b + c + 1);
        add(1);
        add(c + d + 1);
        add(b);
        add(l);
      }
    };
    cout << (int)ans.size() << "\n";
    for (int i = 0; i < (int)ans.size(); ++i) {
      cout << ans[i] << ' ';
    }
  }
  void add(int i) {
    ans.push_back(i);
    shift(i);
  }
  void shift(int a) {
    string u = s.substr(l - a);
    reverse(u.begin(), u.end());
    s = u + s;
    s.resize(l);
  }
};
}  // namespace Problem
int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  long long n = 0;
  std::cin >> n;
  Problem::Solver sol(n);
  sol.solve();
  Problem::Writer::write();
  return 0;
}