Problem: Another feature of Shakespeare language is that the variables are named after characters of plays by Shakespeare, and all operations on them (value assignment, output etc.) look like a dialog with other characters. New values of variables are defined in a rather lengthy way, so a programmer should try to minimize their usage.

You have to print the given sequence of n integers. To do this, you have m variables and two types of operations on them:

  * variable=integer
  * print(variable)



Any of the m variables can be used as variable. Variables are denoted by lowercase letters between "a" and "z", inclusive. Any integer number can be used as integer.

Let's say that the penalty for using first type of operations equals to the number of set bits in the number integer. There is no penalty on using second type of operations. Find and output the program which minimizes the penalty for printing the given sequence of numbers.

Input

The first line of input contains integers n and m (1 ≤ n ≤ 250, 1 ≤ m ≤ 26). The second line contains the sequence to be printed. Each element of the sequence is an integer between 1 and 109, inclusive. The sequence has to be printed in the given order (from left to right).

Output

Output the number of lines in the optimal program and the optimal penalty. Next, output the program itself, one command per line. If there are several programs with minimal penalty, output any of them (you have only to minimize the penalty).

Examples

Input

7 2
1 2 2 4 2 1 2


Output

11 4
b=1
print(b)
a=2
print(a)
print(a)
b=4
print(b)
print(a)
b=1
print(b)
print(a)


Input

6 3
1 2 3 1 2 3


Output

9 4
c=1
print(c)
b=2
print(b)
a=3
print(a)
print(c)
print(b)
print(a)

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double oo = 1e9;
template <class Flow, class Cost>
struct MinCostFlow {
  struct Edge {
    int v, inv;
    Flow c, f;
    Cost w;
    Edge(){};
    Edge(int v, Flow c, Cost w, int inv) : v(v), inv(inv), c(c), f(0), w(w) {}
  };
  int n, s, t;
  vector<vector<Edge> > e;
  vector<Cost> d;
  vector<int> parent, pEdge, state;
  deque<int> q;
  MinCostFlow(int n, int s = 1, int t = 2)
      : n(n),
        s(s),
        t(t),
        e(n + 1),
        d(n + 1),
        parent(n + 1),
        pEdge(n + 1),
        state(n + 1) {}
  void addEdge(int u, int v, Flow c, Cost w) {
    int i = e[u].size(), j = e[v].size();
    e[u].push_back(Edge(v, c, w, j));
    e[v].push_back(Edge(u, 0, -w, i));
  }
  bool findPath() {
    for (int i = 1; i <= n; ++i) {
      d[i] = oo;
      state[i] = 0;
      parent[i] = pEdge[i] = -1;
    }
    d[s] = 0;
    while (!q.empty()) q.pop_front();
    q.push_front(s);
    while (!q.empty()) {
      int u = q.front();
      q.pop_front();
      state[u] = 2;
      for (int i = 0, sz = (int)e[u].size(); i < sz; ++i)
        if (e[u][i].f < e[u][i].c) {
          int v = e[u][i].v;
          Cost tmp = d[u] + e[u][i].w;
          if (tmp + EPS < d[v]) {
            d[v] = tmp;
            parent[v] = u;
            pEdge[v] = i;
            if (state[v] == 0)
              q.push_back(v);
            else if (state[v] == 2)
              q.push_front(v);
            state[v] = 1;
          }
        }
    }
    return (parent[t] > -1);
  }
  pair<Flow, Cost> getFlow(Flow flowLimit = oo) {
    Flow flow = 0;
    Cost cost = 0;
    while (findPath()) {
      Flow add = flowLimit - flow;
      if (add <= 0) break;
      for (int v = t; v != s; v = parent[v]) {
        int u = parent[v], i = pEdge[v];
        add = min(add, e[u][i].c - e[u][i].f);
      }
      for (int v = t; v != s; v = parent[v]) {
        int u = parent[v], i = pEdge[v];
        e[u][i].f += add;
        e[v][e[u][i].inv].f -= add;
        cost += Cost(add) * e[u][i].w;
      }
      flow += add;
    }
    return make_pair(flow, cost);
  }
};
const int N = 555;
const int cInf = 1e6;
int A[N], rnk[N];
int value[N];
int main() {
  int n, m;
  unordered_set<int> S;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", A + i);
    S.insert(A[i]);
  }
  m = min(m, (int)S.size());
  S.clear();
  int source = 2 * n + 1;
  int sink = 2 * n + 2;
  MinCostFlow<int, long long> mcmf(2 * n + 2, source, sink);
  for (int i = 1; i <= n; ++i) {
    mcmf.addEdge(source, i, 1, __builtin_popcount(A[i]));
    mcmf.addEdge(i, i + n, 1, -cInf);
    mcmf.addEdge(i + n, sink, 1, 0);
    for (int j = i + 1; j <= n; ++j) {
      int cost = 0;
      if (A[i] != A[j]) cost = __builtin_popcount(A[j]);
      mcmf.addEdge(i + n, j, 1, cost);
    }
  }
  auto res = mcmf.getFlow(m);
  long long penalty = (res.second % cInf + cInf) % cInf;
  int vID = 0, assn = n;
  for (const auto &e : mcmf.e[source]) {
    if (e.f > 0) {
      rnk[e.v] = vID++;
      ++assn;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (const auto &e : mcmf.e[i + n]) {
      if (e.f > 0) {
        rnk[e.v] = rnk[i];
        if (A[e.v] != A[i] && e.v != sink) {
          ++assn;
        }
        break;
      }
    }
  }
  printf("%d %lld\n", assn, penalty);
  for (int i = 1; i <= n; ++i) {
    if (value[rnk[i]] != A[i]) {
      assert(A[i] != 0);
      printf("%c=%d\n", (char)(rnk[i] + 'a'), A[i]);
      value[rnk[i]] = A[i];
    }
    printf("print(%c)\n", (char)('a' + rnk[i]));
  }
  return 0;
}