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.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jialin Ouyang (Jialin.Ouyang@gmail.com)
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    QuickScanner in = new QuickScanner(inputStream);
    QuickWriter out = new QuickWriter(outputStream);
    TaskE solver = new TaskE();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskE {
    int n;
    int m;
    Element[] computers;
    Element[] sockets;
    DancingLink cDL;
    DancingLink sDL;
    int c;
    int u;
    int[] a;
    int[] b;

    public void solve(int testNumber, QuickScanner in, QuickWriter out) {
      n = in.nextInt();
      m = in.nextInt();
      computers = new Element[n];
      for (int i = 0; i < n; ++i) computers[i] = new Element(in.nextInt(), i);
      Arrays.sort(computers);
      sockets = new Element[m];
      for (int i = 0; i < m; ++i) sockets[i] = new Element(in.nextInt(), i);
      Arrays.sort(sockets);

      a = new int[m];
      b = new int[n];
      c = u = 0;
      cDL = new DancingLink(n);
      sDL = new DancingLink(m);
      for (int adapter = 0; sDL.first >= 0; ++adapter) {
        for (int cIdx = cDL.first, sIdx = sDL.first; cIdx >= 0 && sIdx >= 0; ) {
          if (computers[cIdx].power < sockets[sIdx].power) {
            cIdx = cDL.next[cIdx];
          } else if (computers[cIdx].power > sockets[sIdx].power) {
            sIdx = sDL.next[sIdx];
          } else {
            a[sockets[sIdx].idx] = adapter;
            b[computers[cIdx].idx] = sockets[sIdx].idx + 1;
            ++c;
            u += adapter;
            cDL.cover(cIdx);
            sDL.cover(sIdx);
            cIdx = cDL.next[cIdx];
            sIdx = sDL.next[sIdx];
          }
        }
        for (int sIdx = sDL.first; sIdx >= 0; sIdx = sDL.next[sIdx]) {
          Element socket = sockets[sIdx];
          if (socket.power == 1) {
            sDL.cover(sIdx);
          } else {
            socket.power = (socket.power + 1) >> 1;
          }
        }
      }
      out.println(c, u);
      out.println(a);
      out.println(b);
    }

    class Element implements Comparable<Element> {
      int power;
      int idx;

      public Element(int power, int idx) {
        this.power = power;
        this.idx = idx;
      }


      public int compareTo(Element o) {
        return power - o.power;
      }

    }

  }

  static class QuickScanner {
    private static final int BUFFER_SIZE = 1024;
    private InputStream stream;
    private byte[] buffer;
    private int currentPosition;
    private int numberOfChars;

    public QuickScanner(InputStream stream) {
      this.stream = stream;
      this.buffer = new byte[BUFFER_SIZE];
      this.currentPosition = 0;
      this.numberOfChars = 0;
    }

    public int nextInt() {
      int c = nextNonSpaceChar();
      boolean positive = true;
      if (c == '-') {
        positive = false;
        c = nextChar();
      }
      int res = 0;
      do {
        if (c < '0' || '9' < c) throw new RuntimeException();
        res = res * 10 + c - '0';
        c = nextChar();
      } while (!isSpaceChar(c));
      return positive ? res : -res;
    }

    public int nextNonSpaceChar() {
      int res = nextChar();
      for (; isSpaceChar(res) || res < 0; res = nextChar()) ;
      return res;
    }

    public int nextChar() {
      if (numberOfChars == -1) {
        throw new RuntimeException();
      }
      if (currentPosition >= numberOfChars) {
        currentPosition = 0;
        try {
          numberOfChars = stream.read(buffer);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
        if (numberOfChars <= 0) {
          return -1;
        }
      }
      return buffer[currentPosition++];
    }

    public boolean isSpaceChar(int c) {
      return c == ' '
          || c == '\n'
          || c == '\r'
          || c == '\t'
          || c < 0;
    }

  }

  static class DancingLink {
    public int first;
    public int[] prev;
    public int[] next;

    public DancingLink(int capacity) {
      prev = new int[capacity];
      next = new int[capacity];
      init(capacity);
    }

    public void init(int n) {
      for (int i = 0; i < n; ++i) {
        prev[i] = i - 1;
        next[i] = i + 1;
      }
      next[n - 1] = -1;
      first = 0;
    }

    public void cover(int idx) {
      int prevIdx = prev[idx], nextIdx = next[idx];
      if (prevIdx >= 0) {
        next[prevIdx] = nextIdx;
      } else {
        first = nextIdx;
      }
      if (nextIdx >= 0) {
        prev[nextIdx] = prevIdx;
      }
    }

  }

  static class QuickWriter {
    private final PrintWriter writer;

    public QuickWriter(OutputStream outputStream) {
      this.writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public QuickWriter(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 println(Object... objects) {
      print(objects);
      writer.print('\n');
    }

    public void print(int[] objects) {
      print(objects, ' ');
    }

    public void print(int[] objects, char delimiter) {
      for (int i = 0; i < objects.length; ++i) {
        if (i > 0) {
          writer.print(delimiter);
        }
        writer.print(objects[i]);
      }
    }

    public void println(int[] objects) {
      print(objects);
      writer.print('\n');
    }

    public void close() {
      writer.close();
    }

  }
}