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.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.pow;
import static java.lang.Math.abs;

import static java.lang.String.format;


public class Main {
    final static int INF = Integer.MAX_VALUE >> 1;
    final static int MOD = 1_000_000_007;
    final static int[] dx4 = {0, 1, 0, -1};
    final static int[] dy4 = {1, 0, -1, 0};
    final static int[] dx8 = {0, 1, 1, 1, 0, -1, -1, -1};
    final static int[] dy8 = {1, 1, 0, -1, -1, -1, 0, 1};

    public static void main(String[] args) {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        char[] l = sc.next().toCharArray();
        char[] r = sc.next().toCharArray();
        Map<Character, Deque<Integer>> mapL = new HashMap<>();
        Map<Character, Deque<Integer>> mapR = new HashMap<>();
        for (int i = 0; i < n; i++) {
            Deque<Integer> dequeL = mapL.getOrDefault(l[i], new ArrayDeque<>());
            Deque<Integer> dequeR = mapR.getOrDefault(r[i], new ArrayDeque<>());
            dequeL.add(i);
            dequeR.add(i);
            mapL.put(l[i], dequeL);
            mapR.put(r[i], dequeR);
        }
        List<FixedIntPair> ansList = new ArrayList<>();
        for (char c = 'a'; c <= 'z'; c++) {
            Deque<Integer> dequeL = mapL.getOrDefault(c, new ArrayDeque<>());
            Deque<Integer> dequeR = mapR.getOrDefault(c, new ArrayDeque<>());
            while (dequeL.size() > 0 && dequeR.size() > 0) {
                ansList.add(new FixedIntPair(dequeL.remove(), dequeR.remove()));
            }
        }
        Deque<Integer> dequeL_ = mapL.getOrDefault('?', new ArrayDeque<>());
        for (char c = 'a'; c <= 'z'&&dequeL_.size()>0; c++) {
            Deque<Integer> dequeR = mapR.getOrDefault(c, new ArrayDeque<>());
            while(dequeR.size()>0&&dequeL_.size()>0){
                ansList.add(new FixedIntPair(dequeL_.remove(), dequeR.remove()));
            }
        }
        Deque<Integer> dequeR_ = mapR.getOrDefault('?', new ArrayDeque<>());
        for (char c = 'a'; c <= 'z'&&dequeR_.size()>0; c++) {
            Deque<Integer> dequeL = mapL.getOrDefault(c, new ArrayDeque<>());
            while(dequeR_.size()>0&&dequeL.size()>0){
                ansList.add(new FixedIntPair(dequeL.remove(), dequeR_.remove()));
            }
        }
        while (dequeL_.size() > 0 && dequeR_.size() > 0) {
            ansList.add(new FixedIntPair(dequeL_.remove(), dequeR_.remove()));
        }
        StringBuilder sb = new StringBuilder();
        sb.append(ansList.size() + "\n");
        for (FixedIntPair fip : ansList) {
            sb.append((fip.x + 1) + " " + (fip.y + 1) + "\n");
        }
        print(sb);


    }


    public static void print(Object object) {
        System.out.print(object);
    }

    public static void put(Object object) {
        System.out.println(object);
    }

    public static void put() {
        System.out.println();
    }

    public static void printE(Object object) {
        System.err.print("DEBUG:" + object);
    }

    public static void putE(Object object) {
        System.err.println("DEBUG:" + object);
    }

    public static void putE() {
        System.err.println("DEBUG:");
    }

    public static void print(String format, Object... args) {
        System.out.print(String.format(format, args));
    }

    public static void put(String format, Object... args) {
        System.out.println(String.format(format, args));
    }

    public static void printE(String format, Object... args) {
        System.err.print("DEBUG:" + String.format(format, args));
    }

    public static void putE(String format, Object... args) {
        System.err.println("DEBUG:" + String.format(format, args));
    }

    final static private class Scanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte())
                return buffer[ptr++];
            else
                return -1;
        }

        private boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr]))
                ptr++;
            return hasNextByte();
        }

        public String next() {
            if (!hasNext())
                throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    final static private class FixedIntPair {
        final public int x, y;
        final static public FixedIntPair ZEROS = new FixedIntPair(0, 0);

        FixedIntPair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        public static double distance(FixedIntPair fip1, FixedIntPair fip2) {
            double x = (double) fip1.x - fip2.x;
            double y = (double) fip1.y - fip2.y;
            return Math.sqrt(x * x + y * y);
        }

        @Override
        public int hashCode() {
            return x + y;
        }

        @Override
        public boolean equals(Object obj) {
            boolean result = super.equals(obj);
            if (obj.getClass() != this.getClass()) {
                return false;
            }
            FixedIntPair pair = (FixedIntPair) obj;
            if (this.x == pair.x && this.y == pair.y) return true;
            return false;
        }

        @Override
        public String toString() {
            return String.format(FixedIntPair.class.getSimpleName() + ":(%d,%d)", x, y);
        }
    }

    final static private class FixedLongPair {
        final public long x, y;
        final static public FixedLongPair ZEROS = new FixedLongPair(0, 0);

        FixedLongPair(long x, long y) {
            this.x = x;
            this.y = y;
        }

        public static double distance(FixedLongPair flp1, FixedLongPair flp2) {
            double x = (double) flp1.x - flp2.x;
            double y = (double) flp1.y - flp2.y;
            return Math.sqrt(x * x + y * y);
        }

        @Override
        public int hashCode() {
            return (int) x + (int) y;
        }

        @Override
        public boolean equals(Object obj) {
            boolean result = super.equals(obj);
            if (obj.getClass() != this.getClass()) {
                return false;
            }
            FixedLongPair pair = (FixedLongPair) obj;
            if (this.x == pair.x && this.y == pair.y) return true;
            return false;
        }

        @Override
        public String toString() {
            return String.format(FixedLongPair.class.getSimpleName() + ":(%d,%d)", x, y);
        }
    }

    final static private class Binary {
        public static String toZeroPadding(int i) {
            return String.format("%" + Integer.toBinaryString(-1).length() + "s", Integer.toBinaryString(i)).replace(' ', '0');
        }

        public static String toZeroPadding(long i) {
            return String.format("%" + Long.toBinaryString(-1).length() + "s", Long.toBinaryString(i)).replace(' ', '0');
        }
    }

    final static private class Util {
        static long gcd(long a, long b) {
            //最大公約数　
            if (a % b == 0) return b;
            return gcd(b, a % b);
        }

        static long lcm(long a, long b) {
            //最小公倍数
            long gcd = gcd(a, b);
            long result = b / gcd;
            return a * result;
        }

        static <T extends Comparable<T>> Map<T, Integer> count(List<T> list) {
            //副作用
            Collections.sort(list);
            Map<T, Integer> result = new HashMap<>();
            int l = 0, r = 0;
            while (l < list.size()) {
                while (r < list.size() - 1 && list.get(r).equals(r + 1)) {
                    r++;
                }
                result.put(list.get(r), r - l + 1);
                r++;
                l = r;
            }
            return result;

        }

        static Map<Integer, Integer> count(int[] array) {
            //副作用
            Arrays.sort(array);
            Map<Integer, Integer> result = new HashMap<>();
            int l = 0, r = 0;
            while (l < array.length) {
                while (r < array.length - 1 && array[r] == array[r + 1]) {
                    r++;
                }
                result.put(array[l], r - l + 1);
                r++;
                l = r;
            }
            return result;
        }

        static <T> String toStringBWS(Iterable<T> iterable) {
            Iterator<T> ite = iterable.iterator();
            return toStringBWS(ite);
        }

        static <T> String toStringBWS(Iterator<T> ite) {
            StringBuilder sb = new StringBuilder();
            sb.append(ite.next());
            while (ite.hasNext()) {
                sb.append(" ");
                sb.append(ite.next());
            }
            return sb.toString();
        }

        static long factoringInPrimeNumbers(long n, int[] a) {
            //素因数分解
            for (int i = 2; n > 1 && i < a.length; i++) {
                while (n % i == 0) {
                    a[i]++;
                    n /= i;
                }
            }
            return n;

        }

        static boolean isValidCell(int i, int j, int h, int w) {
            return i >= 0 && i < h && j >= 0 && j < w;
        }
    }
}