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.math.*;
    import java.util.*;
import java.util.concurrent.DelayQueue;    
          public class Main
           {
            private InputStream is;
            private PrintWriter out;
            static int MOD = (int)(1e9+7);
            ArrayList<Integer>[] amp;
            public static void main(String[] args) throws Exception
            {
                new Thread(null, new Runnable()
                {
                public void run()
                {
                    try {
         } catch (Exception e)
                    {
                        System.out.println(e);
                    }
                }
            }, "1", 1 << 26).start();
                new Main().soln();
            }
            char ch[][];
            static ArrayList<Integer>[] g=new ArrayList[100001];
            static ArrayList<Integer> ar[];
            static long ok[];    
            static int phi[]=new int[500005];
            static int dp[][];
            void solve()
            {
            	/*int n = ni();
            	int a[] = na(n-1);
            	
            	for(int i=0;i<n-1;i++) {
            		if(a[i]==0) {
            			out.println(-1);
            			return;
            		}
            	}
            	
            	int mins = 0;
            	int plus = 0;
            	for(int i=0;i<n-1;i++) {
            		if(a[i]==1)plus++;
            		else if(a[i]==-1) mins++;
            	}
            	if(plus==n-1) {
            		for(int i=0;i<n;i++) {
            			out.print(i+1);
            			out.print(" ");
            		}
            		return;
            	}
            	if(mins==n-1) {
            		for(int i=n;i>=1;i--) {
            			out.print(i);
            			out.print(" ");
            		}
            		return;
            	}
            	int fr1[] = new int[n+1];
             	int check[] = new int[n];
             	check[0]=n;
             	fr1[n]++;
             	for(int i=1;i<n;i++) {
             		check[i]=a[i-1]+check[i-1];
             		if(check[i]<=0||check[i]>=n)break;
             		fr1[check[i]]++;
             	}
             	int fr2[] = new int[n+1];
             	int check2[] = new int[n];
             	check2[0]=1;
             	fr2[1]++;
             	for(int i=1;i<n;i++) {
             		check2[i]=a[i-1]+check2[i-1];
             		if(check2[i]<=1||check2[i]>n)break;
             		fr2[check2[i]]++;
             	}
             	int c1=0;
             	int c2=0;
             	for(int i=1;i<=n;i++)if(fr1[i]==1)c1++;

             	for(int i=1;i<=n;i++)if(fr2[i]==1)c2++;
             	
             	if(c1==n) {
             		for(int i=0;i<n;i++)
             			out.print(check[i]+" ");
             		return;
             	}
             	else if(c2==n) {
             		for(int i=0;i<n;i++)
             			out.print(check2[i]+" ");
             		return;
             	}
            	ArrayList<Integer> ar = new ArrayList();
            	int curr = a[0];
            	ar.add(curr);
             	for(int i=1;i<n-1;i++) {
             		curr+=a[i];
            		ar.add(curr);
            	}
             	Collections.sort(ar);
             	int start = -1;
             	boolean bool = false;
             	for(int i=0;i<ar.size()-1;i++) {
             		if(ar.get(i+1)-ar.get(i)==2&&bool) {
             			out.println(-1);
             			return;
             		}
             		if(ar.get(i+1)-ar.get(i)==2&&!bool) {
             			start = ar.get(i+1)-ar.get(i);
             			bool = true;
             		}
             		
             		if(ar.get(i+1)-ar.get(i)>2) {
             			
             			out.println(-1);
             			return;
             		}
             	}
             	if(start == -1) {
             		out.println(-1);
             		return;
             	}
             	int ans[] = new int[n];
             	ans[0]=start;
             	
             	int fr3[] = new int[n+1];
             	fr3[start]++;
             	for(int i=1;i<n;i++) {
             		ans[i]=a[i-1]+ans[i-1];
             		if(ans[i]<=0||ans[i]>n)break;
             		fr3[ans[i]]++;
             	}
             	
             	int count=0;
             	for(int i=1;i<=n;i++)if(fr3[i]==1)count++;
             	if(count==n) {
             		for(int i=0;i<n;i++)out.print(ans[i]+" ");
             		return;
             	}
             	out.println(-1);*/
            	int n = ni();
            	String p = ns();
             	String s = ns();
             	Stack<Integer> ar[] = new Stack[26];

             	Stack<Integer> ar1[] = new Stack[26];
             	for(int i=0;i<26;i++) {
             		ar[i] = new Stack<Integer>();
             		ar1[i] = new Stack<Integer>();
             	
             	}
             	Stack<Integer> q1 = new Stack();
             	Stack<Integer> q2 = new Stack();
             	for(int i=0;i<p.length();i++) {
             		if(p.charAt(i)=='?')
             			q1.add(i);
             		else
             		ar[p.charAt(i)-'a'].add(i);
             	}
             	for(int i=0;i<s.length();i++) {
             		if(s.charAt(i)=='?')
             			q2.add(i);
             		else
             		ar1[s.charAt(i)-'a'].add(i);}
             	ArrayList<String> ans = new ArrayList();
             	for(int i=0;i<26;i++) {
             		int min = Math.min(ar1[i].size(),ar[i].size());
             		for(int j=0;j<min;j++) {
             			ans.add((ar[i].pop()+1)+" "+(ar1[i].pop()+1));
             		}
             	}
             	for(int i=0;i<26;i++) {
             		if(ar[i].size()>0) {
             			for(int j=0;j<ar[i].size();j++) {
             				if(!q2.isEmpty()) {
             					ans.add((ar[i].get(j)+1)+" "+(q2.pop()+1));
             				}
             			}
             		}
             	}
             	for(int i=0;i<26;i++) {
             		if(ar1[i].size()>0) {
             			for(int j=0;j<ar1[i].size();j++) {
             				if(!q1.isEmpty()) {
             					ans.add((q1.pop()+1)+" "+(ar1[i].get(j)+1));
             				}
             			}
             		}
             	}
             	while(!q1.isEmpty()&&!q2.isEmpty()) {
             		ans.add((q1.pop()+1)+" "+(q2.pop()+1));
             	}
             	out.println(ans.size());
             	for(int i=0;i<ans.size();i++)
             		out.println(ans.get(i));
            }
            
            
            public static void update(int v,int tl,int tr,long l,long harami2)
            {
            	if(tl==tr)
                {
                    tre[v]=harami2;
                }
                else
                {
                    int mid=(tl+tr)/2;
                    if(tl <= l &&l <= mid)
                    {
                        update(2*v,tl, mid, l, harami2);
                    }
                    else
                    {
                        update(2*v+1,mid+1,tr, l, harami2);
                    }
                    tre[v]=tre[2*v]+tre[2*v+1];
                }
            }
            static long tre[]=new long[8000005];
            
            public static void permute(char s[],int l,int r)
            {
            	if(l==r)
            	{
            		System.out.println(new String(s));
            	}
            	else
            	{
            		for(int i=l;i<=r;i++)
            		{
            			char temp=s[i];
            			s[i]=s[l];
            			s[l]=temp;
            			permute(s,l+1,r);
            			temp=s[i];
            			s[i]=s[l];
            			s[l]=temp;
            		}
            	}
            }
            
           
            
            public static long pr(long x,long y,long m)
            {
            	if(y==0)
            		return 1;
            	long p = pr(x,y/2,m);
            	p=(p*p)%m;
            	return(y%2==0)?(p):(x*p%m);
            }
            public static long GCD(long x,long y)
            {
            	if(y==0)
            		return x;
            	else
            		return GCD(y,x%y);
            }
            
            
            
            static boolean visi1[];
            static int cont=0;
            static int para[];
            public static void dfs(int curr,int pr)
            {
            	visi1[curr]=true;
            	
            	int trees=0;
            	for(int x:g[curr])
            	{
            		if(!visi1[x]&&x!=pr)
            		{
            			trees++;
            			dfs(x,pr);
            		}
            	}
            	if(trees==0)cont++;
            }
            
            static boolean visited[][];
			static int a[][];
            
          
            
            static int d,x,y;
            static void exE(int a,int b)
            {
            	if(b==0)
            	{
            		d=a;
            		x=1;
            		y=0;
            	}
            	else
            	{
            		exE(b,a%b);
            		int tmp=x;
            		x=y;
            		y=tmp - (a/b)*y;
            	}
            }
            boolean isPrime(long curr)
                {
                if(curr==0||curr==1)
                    return false;
                for(long i = 2;i*1L*i<=curr;i++) if(curr%i==0) return false;
                return true;
            }
            int  p ;
            long modInverse(long a, long mOD2){
                return  power(a, mOD2-2, mOD2);
            }
            long power(long x, long y, long m)
            {
            if (y == 0)
            return 1;
            long p = power(x, y/2, m) % m;
            p = (p * p) % m;
        
            return (y%2 == 0)? p : (x * p) % m;
            }
            public static long gcd(long a, long b){
                if(b==0) return a;
                return gcd(b,a%b);
            }
            class Pair1 implements Comparable<Pair1>{
                int a;
                int b;
                int c;
                Pair1(int a,int b,int c){
                	this.a = a;
                	this.b = b;
                	this.c = c;
                }
                public int hashCode() {
                    return Objects.hash();
                }
                
                @Override
                public int compareTo(Pair1 arg0) {
                    return (int)(c-arg0.c);
                }    
            }
            long power(long x, long y, int mod){
                long ans = 1;
                while(y>0){
                    if(y%2==0){
                        x = (x*x)%mod;
                        y/=2;
                    }
                    else{
                        ans = (x*ans)%mod;
                        y--;
                    }
                }
                return ans;
            }
            void soln() {
                is = System.in;
                out = new PrintWriter(System.out);
                long s = System.currentTimeMillis();
                solve();
                out.flush();
            }
             private byte[] inbuf = new byte[1024];
            public int lenbuf = 0, ptrbuf = 0;
            private int readByte() {
                if (lenbuf == -1)
                    throw new InputMismatchException();
                if (ptrbuf >= lenbuf) {
                    ptrbuf = 0;
                    try {
                        lenbuf = is.read(inbuf);
                    } catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if (lenbuf <= 0)
                        return -1;
                }
                return inbuf[ptrbuf++];
            }
            private boolean isSpaceChar(int c) {
                return !(c >= 33 && c <= 126);
            }
            private int skip() {
                int b;
                while ((b = readByte()) != -1 && isSpaceChar(b))
                    ;
                return b;
            }
            private double nd() {
                return Double.parseDouble(ns());
            }
            private char nc() {
                return (char) skip();
            }
            private String ns() {
                int b = skip();
                StringBuilder sb = new StringBuilder();
                while (!(isSpaceChar(b))) {
                    sb.appendCodePoint(b);
                    b = readByte();
                }
                return sb.toString();
            }
            private char[] ns(int n) {
                char[] buf = new char[n];
                int b = skip(), p = 0;
                while (p < n && !(isSpaceChar(b))) {
                    buf[p++] = (char) b;
                    b = readByte();
                }
                return n == p ? buf : Arrays.copyOf(buf, p);
            }
            private int[][] nm(int n, int m) {
                int[][] map = new int[n][m];
                for (int i = 0; i < n; i++)
                {
                    for(int j=0;j<m;j++)
                        map[i][j]=ni();
                }
                return map;
            }
            private int[] na(int n) {
                int[] a = new int[n];
                for (int i = 0; i < n; i++)
                    a[i] = ni();
                return a;
            }
            private int ni() {
                int num = 0, b;
                boolean minus = false;
                while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
                    ;
                if (b == '-') {
                    minus = true;
                    b = readByte();
                }
                while (true) {
                    if (b >= '0' && b <= '9') {
                        num = num * 10 + (b - '0');
                    } else {
                        return minus ? -num : num;
                    }
                    b = readByte();
                }
            }
            private long nl() {
                long num = 0;
                int b;
                boolean minus = false;
                while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
                    ;
                if (b == '-') {
                    minus = true;
                    b = readByte();
                }
                while (true) {
                    if (b >= '0' && b <= '9') {
                        num = num * 10 + (b - '0');
                    } else {
                        return minus ? -num : num;
                    }
                    b = readByte();
                }
            }
            private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
            private void tr(Object... o) {
                if (!oj)
                    System.out.println(Arrays.deepToString(o));
            }
        }