#include <bits/stdc++.h>   using namespace std;   int n;   string a, b;   set<int> A, B;   queue<int> qA, qB;   map<char, queue<int> > q;   vector<pair<int, int> > resp;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n >> a >> b;     for (int i = 0; i < n; ++i) {       if (a[i] ==  ? )         qA.push(i);       else {         q[a[i]].push(i);         A.insert(i);       }     }     for (int i = 0; i < n; ++i) {       if (b[i] ==  ? )         qB.push(i);       else         B.insert(i);     }     for (int i = 0; i < n; ++i) {       if (!q[b[i]].empty()) {         resp.push_back({q[b[i]].front(), i});         B.erase(i);         A.erase(q[b[i]].front());         q[b[i]].pop();       }     }     while (!qA.empty() && !B.empty()) {       auto it = B.begin();       resp.push_back({qA.front(), *it});       qA.pop();       B.erase(it);     }     while (!qB.empty() && !A.empty()) {       auto it = A.begin();       resp.push_back({*it, qB.front()});       qB.pop();       A.erase(it);     }     while (!qA.empty() && !qB.empty()) {       resp.push_back({qA.front(), qB.front()});       qA.pop();       qB.pop();     }     cout << (int)resp.size() <<   n ;     for (auto x : resp) cout << x.first + 1 <<     << x.second + 1 <<   n ;     return 0;   }   