Problem: There are n left boots and n right boots. Each boot has a color which is denoted as a lowercase Latin letter or a question mark ('?'). Thus, you are given two strings l and r, both of length n. The character l_i stands for the color of the i-th left boot and the character r_i stands for the color of the i-th right boot.

A lowercase Latin letter denotes a specific color, but the question mark ('?') denotes an indefinite color. Two specific colors are compatible if they are exactly the same. An indefinite color is compatible with any (specific or indefinite) color.

For example, the following pairs of colors are compatible: ('f', 'f'), ('?', 'z'), ('a', '?') and ('?', '?'). The following pairs of colors are not compatible: ('f', 'g') and ('a', 'z').

Compute the maximum number of pairs of boots such that there is one left and one right boot in a pair and their colors are compatible.

Print the maximum number of such pairs and the pairs themselves. A boot can be part of at most one pair.

Input

The first line contains n (1 ≤ n ≤ 150000), denoting the number of boots for each leg (i.e. the number of left boots and the number of right boots).

The second line contains the string l of length n. It contains only lowercase Latin letters or question marks. The i-th character stands for the color of the i-th left boot.

The third line contains the string r of length n. It contains only lowercase Latin letters or question marks. The i-th character stands for the color of the i-th right boot.

Output

Print k — the maximum number of compatible left-right pairs of boots, i.e. pairs consisting of one left and one right boot which have compatible colors.

The following k lines should contain pairs a_j, b_j (1 ≤ a_j, b_j ≤ n). The j-th of these lines should contain the index a_j of the left boot in the j-th pair and index b_j of the right boot in the j-th pair. All the numbers a_j should be distinct (unique), all the numbers b_j should be distinct (unique).

If there are many optimal answers, print any of them.

Examples

Input


10
codeforces
dodivthree


Output


5
7 8
4 9
2 2
9 10
3 1


Input


7
abaca?b
zabbbcc


Output


5
6 5
2 3
4 6
7 4
1 2


Input


9
bambarbia
hellocode


Output


0


Input


10
code??????
??????test


Output


10
6 2
1 6
7 3
3 5
4 8
9 7
5 1
2 4
10 9
8 10

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
inline int readInt() {
  int x;
  scanf("%d", &x);
  return x;
}
const double EPS = 1E-8;
class UnionFind {
 public:
  vector<int> par;
  vector<int> siz;
  UnionFind(int sz_) : par(sz_), siz(sz_, 1) {
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  void init(int sz_) {
    par.resize(sz_);
    siz.assign(sz_, 1LL);
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  int root(int x) {
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }
  bool merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }
  bool issame(int x, int y) { return root(x) == root(y); }
  int size(int x) { return siz[root(x)]; }
};
class WeightedUnionFind {
 public:
  vector<int> par;
  vector<int> siz;
  vector<long long> diff_weight;
  WeightedUnionFind(int sz_) : par(sz_), siz(sz_, 1LL), diff_weight(sz_, 0LL) {
    for (int i = 0; i < sz_; i++) par[i] = i;
  }
  void init(int sz_) {
    par.resize(sz_);
    siz.assign(sz_, 1LL);
    diff_weight.resize(sz_);
    for (int i = 0; i < sz_; i++) par[i] = i, diff_weight[i] = 0;
  }
  int root(int x) {
    if (par[x] == x) {
      return x;
    } else {
      int r = root(par[x]);
      diff_weight[x] += diff_weight[par[x]];
      return par[x] = r;
    }
  }
  long long weight(long long x) {
    root(x);
    return diff_weight[x];
  }
  bool issame(int x, int y) { return root(x) == root(y); }
  bool merge(int x, int y, long long w) {
    w += weight(x);
    w -= weight(y);
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y), w = -w;
    siz[x] += siz[y];
    par[y] = x;
    diff_weight[y] = w;
    return true;
  }
  long long diff(int x, int y) { return weight(y) - weight(x); }
};
long long modPow(long long x, long long n, long long mod = 1000000007) {
  if (n <= 0) return 1;
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    res %= mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
bool sieve[5000000 + 10];
void makeSieve() {
  for (int i = 0; i < 5000000 + 10; ++i) sieve[i] = true;
  sieve[0] = sieve[1] = false;
  for (int i = 2; i * i < 5000000 + 10; ++i)
    if (sieve[i])
      for (int j = 2; i * j < 5000000 + 10; ++j) sieve[i * j] = false;
}
bool isprime(long long n) {
  if (n == 0 || n == 1) return false;
  for (long long i = 2; i * i <= n; ++i)
    if (n % i == 0) return false;
  return true;
}
const int MAX = 2000010;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = 1000000007 - inv[1000000007 % i] * (1000000007 / i) % 1000000007;
    finv[i] = finv[i - 1] * inv[i] % 1000000007;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % 1000000007) % 1000000007;
}
long long extGCD(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = extGCD(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
inline long long mod(long long a, long long m) { return (a % m + m) % m; }
long long modinv(long long a, long long m) {
  long long x, y;
  extGCD(a, m, x, y);
  return mod(x, m);
}
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
template <typename Monoid, typename OperatorMonoid = Monoid>
struct LazySegmentTree {
  using F = function<Monoid(Monoid, Monoid)>;
  using G = function<Monoid(Monoid, OperatorMonoid)>;
  using H = function<OperatorMonoid(OperatorMonoid, OperatorMonoid)>;
  using P = function<OperatorMonoid(OperatorMonoid, int)>;
  int sz;
  vector<Monoid> data;
  vector<OperatorMonoid> lazy;
  const F f;
  const G g;
  const H h;
  const P p;
  const Monoid M1;
  const OperatorMonoid OM0;
  LazySegmentTree(int n, const F f, const G g, const H h, const P p,
                  const Monoid &M1, const OperatorMonoid OM0)
      : f(f), g(g), h(h), p(p), M1(M1), OM0(OM0) {
    sz = 1;
    while (sz < n) sz <<= 1;
    data.assign(2 * sz, M1);
    lazy.assign(2 * sz, OM0);
  }
  void set(int k, const Monoid &x) { data[k + sz] = x; }
  void build() {
    for (int k = sz - 1; k > 0; k--) {
      data[k] = f(data[2 * k + 0], data[2 * k + 1]);
      data[k] %= 1000000007;
    }
  }
  void propagate(int k, int len) {
    if (lazy[k] != OM0) {
      if (k < sz) {
        lazy[2 * k + 0] = h(lazy[2 * k + 0], lazy[k]);
        lazy[2 * k + 1] = h(lazy[2 * k + 1], lazy[k]);
      }
      data[k] = g(data[k], p(lazy[k], len));
      lazy[k] = OM0;
    }
  }
  Monoid update(int a, int b, const OperatorMonoid &x, int k, int l, int r) {
    propagate(k, r - l);
    if (r <= a || b <= l) {
      return data[k];
    } else if (a <= l && r <= b) {
      lazy[k] = h(lazy[k], x);
      propagate(k, r - l);
      return data[k];
    } else {
      return data[k] = f(update(a, b, x, 2 * k + 0, l, (l + r) >> 1),
                         update(a, b, x, 2 * k + 1, (l + r) >> 1, r));
    }
  }
  Monoid update(int a, int b, const OperatorMonoid &x) {
    return update(a, b, x, 1, 0, sz);
  }
  Monoid query(int a, int b, int k, int l, int r) {
    propagate(k, r - l);
    if (r <= a || b <= l) {
      return M1;
    } else if (a <= l && r <= b) {
      return data[k];
    } else {
      return f(query(a, b, 2 * k + 0, l, (l + r) >> 1),
               query(a, b, 2 * k + 1, (l + r) >> 1, r));
    }
  }
  Monoid query(int a, int b) { return query(a, b, 1, 0, sz); }
  Monoid operator[](const int &k) { return query(k, k + 1); }
};
struct Dice {
  const int UP = 0;
  const int FRONT = 1;
  const int RIGHT = 2;
  const int LEFT = 3;
  const int BACK = 4;
  const int DOWN = 5;
  vector<int> d;
  Dice(vector<int> v, int N = 6) {
    d.resize(N);
    for (int i = 0; i < N; i++) {
      d[i] = v[i];
    }
  }
  void rotate(char s) {
    vector<int> tmp = d;
    if (s == 'S') {
      d[0] = tmp[4];
      d[1] = tmp[0];
      d[5] = tmp[1];
      d[4] = tmp[5];
    }
    if (s == 'E') {
      d[0] = tmp[3];
      d[2] = tmp[0];
      d[5] = tmp[2];
      d[3] = tmp[5];
    }
    if (s == 'W') {
      d[0] = tmp[2];
      d[3] = tmp[0];
      d[5] = tmp[3];
      d[2] = tmp[5];
    }
    if (s == 'N') {
      d[0] = tmp[1];
      d[1] = tmp[5];
      d[5] = tmp[4];
      d[4] = tmp[0];
    }
  }
  void spin() {
    vector<int> tmp = d;
    d[1] = tmp[2];
    d[2] = tmp[4];
    d[4] = tmp[3];
    d[3] = tmp[1];
  }
  int operator[](const int &k) { return d[k]; }
  bool issame(Dice &d2) {
    bool res = true;
    for (int i = 0; i < 6; i++) {
      if (d[i] != d2[i]) res = false;
    }
    return res;
  }
};
vector<vector<int>> cnt1(26);
vector<vector<int>> cnt2(26);
int idx1[26], idx2[26];
int qi1, qi2;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  vector<int> q1, q2;
  vector<pair<int, int>> vp;
  for (int i = 0; i < n; i++) {
    if (s[i] != '?')
      cnt1[s[i] - 'a'].push_back(i + 1);
    else
      q1.push_back(i + 1);
    if (t[i] != '?')
      cnt2[t[i] - 'a'].push_back(i + 1);
    else
      q2.push_back(i + 1);
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < min(cnt1[i].size(), cnt2[i].size()); j++) {
      if (idx1[i] >= cnt1[i].size() || idx2[i] >= cnt2[i].size()) break;
      vp.push_back({cnt1[i][idx1[i]], cnt2[i][idx2[i]]});
      idx1[i]++;
      idx2[i]++;
    }
  }
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < min(cnt1[i].size(), q2.size()); j++) {
      if (idx1[i] >= cnt1[i].size() || qi2 >= q2.size()) break;
      vp.push_back({cnt1[i][idx1[i]], q2[qi2]});
      idx1[i]++;
      qi2++;
    }
    for (int j = 0; j < min(cnt2[i].size(), q1.size()); j++) {
      if (idx2[i] >= cnt2[i].size() || qi1 >= q1.size()) break;
      vp.push_back({q1[qi1], cnt2[i][idx2[i]]});
      idx2[i]++;
      qi1++;
    }
  }
  for (int j = 0; j < min(q2.size(), q1.size()); j++) {
    if (qi2 >= q2.size() || qi1 >= q1.size()) break;
    vp.push_back({q1[qi1], q2[qi2]});
    qi2++;
    qi1++;
  }
  cout << vp.size() << endl;
  for (int i = 0; i < vp.size(); i++) {
    cout << vp[i].first << " " << vp[i].second << endl;
  }
  return 0;
}