#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  string S, T;
  cin >> S;
  cin >> T;
  vector<int> x(N), y(N);
  for (int i = 0; i < N; ++i) {
    x[i] = 2 * (S[i] - '0') + (S[i + N] - '0');
    y[i] = 2 * (T[i] - '0') + (T[i + N] - '0');
    if (x[i] == 0 xor y[i] == 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << 2 * N << endl;
  for (int i = 0; i < N; ++i) {
    int m = (y[i] - x[i] + 3) % 3;
    if (m == 0) {
      cout << i << endl;
      cout << i << endl;
    } else if (m == 1) {
      cout << i << endl;
      cout << i + 1 << endl;
    } else {
      cout << i + 1 << endl;
      cout << i << endl;
    }
  }
}