Problem: The ICM ACPC World Finals is coming! Unfortunately, the organizers of the competition were so busy preparing tasks that totally missed an important technical point — the organization of electricity supplement for all the participants workstations.

There are n computers for participants, the i-th of which has power equal to positive integer pi. At the same time there are m sockets available, the j-th of which has power euqal to positive integer sj. It is possible to connect the i-th computer to the j-th socket if and only if their powers are the same: pi = sj. It is allowed to connect no more than one computer to one socket. Thus, if the powers of all computers and sockets are distinct, then no computer can be connected to any of the sockets. 

In order to fix the situation professor Puch Williams urgently ordered a wagon of adapters — power splitters. Each adapter has one plug and one socket with a voltage divider between them. After plugging an adapter to a socket with power x, the power on the adapter's socket becomes equal to <image>, it means that it is equal to the socket's power divided by two with rounding up, for example <image> and <image>.

Each adapter can be used only once. It is possible to connect several adapters in a chain plugging the first to a socket. For example, if two adapters are plugged one after enother to a socket with power 10, it becomes possible to connect one computer with power 3 to this socket.

The organizers should install adapters so that it will be possible to supply with electricity the maximum number of computers c at the same time. If there are several possible connection configurations, they want to find the one that uses the minimum number of adapters u to connect c computers.

Help organizers calculate the maximum number of connected computers c and the minimum number of adapters u needed for this.

The wagon of adapters contains enough of them to do the task. It is guaranteed that it's possible to connect at least one computer.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 200 000) — the number of computers and the number of sockets.

The second line contains n integers p1, p2, ..., pn (1 ≤ pi ≤ 109) — the powers of the computers. 

The third line contains m integers s1, s2, ..., sm (1 ≤ si ≤ 109) — the power of the sockets. 

Output

In the first line print two numbers c and u — the maximum number of computers which can at the same time be connected to electricity and the minimum number of adapters needed to connect c computers.

In the second line print m integers a1, a2, ..., am (0 ≤ ai ≤ 109), where ai equals the number of adapters orginizers need to plug into the i-th socket. The sum of all ai should be equal to u.

In third line print n integers b1, b2, ..., bn (0 ≤ bi ≤ m), where the bj-th equals the number of the socket which the j-th computer should be connected to. bj = 0 means that the j-th computer should not be connected to any socket. All bj that are different from 0 should be distinct. The power of the j-th computer should be equal to the power of the socket bj after plugging in abj adapters. The number of non-zero bj should be equal to c.

If there are multiple answers, print any of them.

Examples

Input

2 2
1 1
2 2


Output

2 2
1 1
1 2


Input

2 1
2 100
99


Output

1 6
6
1 0

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Iterator;
import java.io.BufferedWriter;
import java.util.AbstractSet;
import java.util.Set;
import java.util.InputMismatchException;
import java.util.Random;
import java.io.IOException;
import java.util.ArrayList;
import java.util.AbstractMap;
import java.util.Map;
import java.io.Writer;
import java.util.Map.Entry;
import java.io.OutputStreamWriter;
import java.util.NoSuchElementException;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskE {
        int POWER = 31;
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt(), m = in.readInt();
            int[] p = IOUtils.readIntArray(in, n);
            EHashMap<Integer, ArrayList<Integer>> computer = new EHashMap<>();
            for (int i = 0; i < p.length; i++) {
                if (!computer.containsKey(p[i])) computer.put(p[i], new ArrayList<Integer>());
                computer.get(p[i]).add(i);
            }
            Socket[] sockets = new Socket[m];
            for (int i = 0; i < m; i++) sockets[i] = new Socket(in.readInt(), i);
            int c = 0, u = 0;
            int[] a = new int[m], b = new int[n];
            for (int power = 0; power < POWER; power++) {
                for (Socket socket : sockets)
                    if (!socket.removed && computer.containsKey(socket.power)) {
                        ArrayList<Integer> al = computer.get(socket.power);
                        int idx = al.get(al.size() - 1);
                        al.remove(al.size() - 1);
                        a[socket.idx] = power;
                        b[idx] = socket.idx + 1;
                        c++;
                        u += power;
                        if (al.isEmpty()) computer.remove(socket.power);
                        socket.removed = true;
                    }
                for (Socket socket : sockets) socket.power = (socket.power + 1) / 2;
            }
            out.printLine(c, u);
            out.printLine(a);
            out.printLine(b);
        }
        class Socket {
            int power;
            int idx;
            boolean removed = false;
            public Socket(int power, int idx) {
                this.power = power;
                this.idx = idx;
            }
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }
        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    static class EHashMap<E, V> extends AbstractMap<E, V> {
        private static final int[] shifts = new int[10];
        private int size;
        private EHashMap.HashEntry<E, V>[] data;
        private int capacity;
        private Set<Entry<E, V>> entrySet;
        static {
            Random random = new Random(System.currentTimeMillis());
            for (int i = 0; i < 10; i++)
                shifts[i] = 1 + 3 * i + random.nextInt(3);
        }
        public EHashMap() {
            this(4);
        }
        private void setCapacity(int size) {
            capacity = Integer.highestOneBit(4 * size);
            //noinspection unchecked
            data = new EHashMap.HashEntry[capacity];
        }
        public EHashMap(int maxSize) {
            setCapacity(maxSize);
            entrySet = new AbstractSet<Entry<E, V>>() {
                public Iterator<Entry<E, V>> iterator() {
                    return new Iterator<Entry<E, V>>() {
                        private EHashMap.HashEntry<E, V> last = null;
                        private EHashMap.HashEntry<E, V> current = null;
                        private EHashMap.HashEntry<E, V> base = null;
                        private int lastIndex = -1;
                        private int index = -1;
                        public boolean hasNext() {
                            if (current == null) {
                                for (index++; index < capacity; index++) {
                                    if (data[index] != null) {
                                        base = current = data[index];
                                        break;
                                    }
                                }
                            }
                            return current != null;
                        }
                        public Entry<E, V> next() {
                            if (!hasNext())
                                throw new NoSuchElementException();
                            last = current;
                            lastIndex = index;
                            current = current.next;
                            if (base.next != last)
                                base = base.next;
                            return last;
                        }
                        public void remove() {
                            if (last == null)
                                throw new IllegalStateException();
                            size--;
                            if (base == last)
                                data[lastIndex] = last.next;
                            else
                                base.next = last.next;
                        }
                    };
                }
                public int size() {
                    return size;
                }
            };
        }
        public EHashMap(Map<E, V> map) {
            this(map.size());
            putAll(map);
        }
        public Set<Entry<E, V>> entrySet() {
            return entrySet;
        }
        public void clear() {
            Arrays.fill(data, null);
            size = 0;
        }
        private int index(Object o) {
            return getHash(o.hashCode()) & (capacity - 1);
        }
        private int getHash(int h) {
            int result = h;
            for (int i : shifts)
                result ^= h >>> i;
            return result;
        }
        public V remove(Object o) {
            if (o == null)
                return null;
            int index = index(o);
            EHashMap.HashEntry<E, V> current = data[index];
            EHashMap.HashEntry<E, V> last = null;
            while (current != null) {
                if (current.key.equals(o)) {
                    if (last == null)
                        data[index] = current.next;
                    else
                        last.next = current.next;
                    size--;
                    return current.value;
                }
                last = current;
                current = current.next;
            }
            return null;
        }
        public V put(E e, V value) {
            if (e == null)
                return null;
            int index = index(e);
            EHashMap.HashEntry<E, V> current = data[index];
            if (current != null) {
                while (true) {
                    if (current.key.equals(e)) {
                        V oldValue = current.value;
                        current.value = value;
                        return oldValue;
                    }
                    if (current.next == null)
                        break;
                    current = current.next;
                }
            }
            if (current == null)
                data[index] = new EHashMap.HashEntry<E, V>(e, value);
            else
                current.next = new EHashMap.HashEntry<E, V>(e, value);
            size++;
            if (2 * size > capacity) {
                EHashMap.HashEntry<E, V>[] oldData = data;
                setCapacity(size);
                for (EHashMap.HashEntry<E, V> entry : oldData) {
                    while (entry != null) {
                        EHashMap.HashEntry<E, V> next = entry.next;
                        index = index(entry.key);
                        entry.next = data[index];
                        data[index] = entry;
                        entry = next;
                    }
                }
            }
            return null;
        }
        public V get(Object o) {
            if (o == null)
                return null;
            int index = index(o);
            EHashMap.HashEntry<E, V> current = data[index];
            while (current != null) {
                if (current.key.equals(o))
                    return current.value;
                current = current.next;
            }
            return null;
        }
        public boolean containsKey(Object o) {
            if (o == null)
                return false;
            int index = index(o);
            EHashMap.HashEntry<E, V> current = data[index];
            while (current != null) {
                if (current.key.equals(o))
                    return true;
                current = current.next;
            }
            return false;
        }
        public int size() {
            return size;
        }
        private static class HashEntry<E, V> implements Entry<E, V> {
            private final E key;
            private V value;
            private EHashMap.HashEntry<E, V> next;
            private HashEntry(E key, V value) {
                this.key = key;
                this.value = value;
            }
            public E getKey() {
                return key;
            }
            public V getValue() {
                return value;
            }
            public V setValue(V value) {
                V oldValue = this.value;
                this.value = value;
                return oldValue;
            }
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }
        public void print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(array[i]);
            }
        }
        public void printLine(int[] array) {
            print(array);
            writer.println();
        }
        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }
        public void close() {
            writer.close();
        }
    }
    static class IOUtils {
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = in.readInt();
            return array;
        }
    }
}