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 JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;
@SuppressWarnings("unchecked")
public class DhakaJi {

    InputStream is;
    PrintWriter out;
    
    long mod = (long)(1e9 + 7), inf = (long)(3e18);
    
    void solve() {
        //SZ = sieve(); //SZ = 1000001;
        int n = ni();
        String left = ns();
        String right = ns();
        ArrayList<Integer> []first = new ArrayList[27];
        ArrayList<Integer> []second = new ArrayList[27];
        for(int i=0;i<27;i++)
        {
            first[i] = new ArrayList<>();
            second[i] = new ArrayList<>();
        }
        for(int i=0;i<n;i++){
            char c = left.charAt(i);
            if(c=='?'){
                first[26].add(i+1);
                continue ;
            }
            first[c-'a'].add(i+1);
        }
        for(int i=0;i<n;i++){
            char c = right.charAt(i);
            if(c=='?'){
                second[26].add(i+1);
                continue ;
            }
            second[c-'a'].add(i+1);
        }
        StringBuilder sb = new StringBuilder("");
        int count = 0 ;
        // boolean []visited1 = new boolean[n+1];
        // boolean []visited2 = new boolean[n+1];
        HashSet<Integer> visited1 = new HashSet<>();
        HashSet<Integer> visited2 = new HashSet<>();
        for(int i=1;i<=n;i++){
            visited1.add(i);
            visited2.add(i);
        }
        for(int i=0;i<26;i++){
            if(first[i].size()==0 || second[i].size()==0)
                continue ;
            count +=Math.min(first[i].size(),second[i].size());
            int x = 0 ,y=0;
            while(x<first[i].size() && y<second[i].size()){
                sb.append(first[i].get(x)+" "+second[i].get(y)+"\n");
                // visited1[first[i].get(x)] = true ;
                // visited2[second[i].get(y)] = true ;
                visited1.remove(first[i].get(x));
                visited2.remove(second[i].get(y));
                x++;
                y++;
            }
        }
        int index = 0 ,k =0;
        // out.println(sb);
        ArrayList<Integer> ar = new ArrayList<>(visited2);
        while(k<ar.size() && index<first[26].size()){
            // for(int i=k;i<=n;i++)
            //     if(!visited2[i] && right.charAt(i-1)!='?'){
            //         sb.append(first[26].get(index)+" "+i+"\n");
            //         visited2[i] = true ;
            //         visited1[first[26].get(index)] = true ;
            //         count++;
            //         k++;
            //         break ;                    
            //     }
            if(right.charAt(ar.get(k)-1)!='?'){
                sb.append(first[26].get(index)+" "+ar.get(k)+"\n");
                // visited2[i] = true ;
                visited2.remove(ar.get(k));
                // visited1[first[26].get(index)] = true ;
                visited1.remove(first[26].get(index));
                count++;
                
                index++;
            }   
            k++;         
        }
        // out.println(sb);
        k=0;
        index=0;        
        ArrayList<Integer> br = new ArrayList<>(visited1);
        while(k<br.size() && index<second[26].size()){                        
                sb.append(br.get(k)+" "+second[26].get(index)+"\n");
                // visited2[i] = true ;
                // visited2.remove(ar.get(k));
                // visited1[first[26].get(index)] = true ;
                // visited1.remove(first[26].get(index));
                count++;
                k++;
                index++;                    
        }
        // while(k<=n && index<second[26].size()){
        //     for(int i=k;i<=n;i++)
        //         if(!visited1[i]){
        //             sb.append(i+" "+second[26].get(index)+"\n");
        //             count++;
        //             ++k;
        //             visited1[i] = true ;
        //             break ;
        //         }
        //     index++;
        // }
        out.println(count);
        out.println(sb);
    }
    
    //--------- Extra Template -----------
    boolean isPrime(long n) {
        if(n <= 1)  return false;
        if(n <= 3)   return true;
        if(n%2 == 0 || n%3 == 0)    return false;
        for(long i = 5; i * i <= n; i += 6) {
            if(n % i == 0 || n % (i + 2) == 0)  return false;
        }
        return true;
    }

    int P[], S[], SZ, NP = 15485900;
    boolean isP[];    

    public int log2(int n){
        if(n <= 0) throw new IllegalArgumentException();
        return 31 - Integer.numberOfLeadingZeros(n);
    }
    int sieve() {
        int i, j, n = NP; 
        isP = new boolean[n]; 
        S = new int[n];
        for(i = 3; i < n; i += 2) {
            isP[i] = true;
            S[i-1] = 2;
            S[i] = i;
        }
        isP[2] = true;
        S[1] = 1;   //(UD)
        for(i = 3; i * i <= n; i += 2) {
            if( !isP[i] )   continue;
            for(j = i * i; j < n; j += i) {
                isP[j] = false;
                if(S[j] == j)   S[j] = i;
            }
        }
        P = new int[n];
        P[0] = 2;
        j = 1;
        for(i = 3; i < n; i += 2) {
            if ( isP[i] )   P[j++] = i;
        }
        P = Arrays.copyOf(P, j);
        return j;
    }
    long gcd(long a,long b){
        while (a!=0 && b!=0) 
        {            
            if(a>b)
               a%=b;
            else
                b%=a;
        }
        return a+b;
    }
    long mp(long b, long e, long mod) {
        b %= mod;
        long r = 1;
        while(e > 0) {
            if((e & 1) == 1) {
                r *= b; r %= mod;
            }
            b *= b; b %= mod;
            e >>= 1;
        }
        return r;
    }

    //---------- I/O Template ----------
    
    public static void main(String[] args) throws Exception { new DhakaJi().run(); }
    void run() throws Exception { 
        is = System.in; 
        out = new PrintWriter(System.out);
        // long s = System.currentTimeMillis();
        solve();
        out.flush();
        // tr((System.currentTimeMillis()-s)/1000+"s");
    }
    
    byte input[] = new byte[1024];
    int len = 0, ptr = 0;
    
    int readByte() { 
        if(ptr >= len) { ptr = 0; 
            try { len = is.read(input); } 
            catch(IOException e) { throw new InputMismatchException(); } 
            if(len <= 0) { return -1; } 
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() { 
        int b = readByte(); 
        while(b != -1 && isSpaceChar(b)) { b = readByte(); } 
        return b;
    }
    
    char nc() { return (char)skip(); }
    String ns() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    String nLine() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    int ni() { 
        int n = 0, b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        if(b == -1) { return -1; }  //no input 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
    long nl() { 
        long n = 0L;    int b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) { 
        int a[] = new int[n]; 
        for(int i = 0; i < n; i++) { a[i] = ni(); } 
        return a;
    }
    char[] ns(int n) { 
        char c[] = new char[n]; 
        int i, b = skip(); 
        for(i = 0; i < n; i++) { 
            if(isSpaceChar(b)) { break; } 
            c[i] = (char)b; b = readByte(); 
        } return i == n ? c : Arrays.copyOf(c,i);
    }
    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}