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 int MAXN = 600;
const int MAXM = 40000;
const int INF = 0x3f3f3f3f;
int n, m;
int a[250], b[250];
struct MinCostMaxFlow {
  struct Edge {
    int v, c, w;
    Edge* next;
    Edge(int v = 0, int c = 0, int w = 0, Edge* next = NULL)
        : v(v), c(c), w(w), next(next) {}
  };
  int n, x, S, T, maxIndex, totalFlow, totalCost, maxflow, mincost;
  bool isFeasibleFlow;
  int psize;
  int diff[MAXN];
  Edge P[MAXM * 2];
  Edge* e[MAXN];
  void updateN(int u, int v) {
    maxIndex = max(maxIndex, max(u, v));
    n = maxIndex + 1;
  }
  bool spfa(int& ret) {
    vector<bool> v(n, false);
    vector<int> mind(n, INF);
    vector<int> c(n, 0);
    Edge* pre[MAXN];
    for (int i = 0; i < n; ++i) {
      pre[i] = NULL;
    }
    queue<int> q;
    q.push(S);
    mind[S] = 0;
    v[S] = true;
    c[S] = INF;
    while (!q.empty()) {
      int t = q.front();
      q.pop();
      v[t] = false;
      for (Edge* i = e[t]; i != NULL; i = i->next) {
        if (mind[t] + i->w < mind[x = i->v] && i->c != 0) {
          mind[x] = mind[t] + i->w;
          c[x] = min(c[t], i->c);
          pre[x] = ((((i)-P) ^ 1) + P);
          if (!v[x]) {
            q.push(x);
            v[x] = true;
          }
        }
      }
    }
    if (c[T] != 0 && (isFeasibleFlow || mind[T] < 0)) {
      maxflow += c[T];
      ret += c[T] * mind[T];
      for (int i = T; i != S; i = pre[i]->v) {
        pre[i]->c += c[T];
        ((((pre[i]) - P) ^ 1) + P)->c -= c[T];
      }
      return true;
    }
    return false;
  }
  int flow(int _S, int _T) {
    updateN(S = _S, T = _T);
    mincost = maxflow = 0;
    while (spfa(mincost))
      ;
    return mincost;
  }
  void init() {
    totalFlow = totalCost = maxIndex = psize = 0;
    isFeasibleFlow = false;
    memset(e, 0, sizeof(e));
    memset(diff, 0, sizeof(diff));
  }
  void addEdge(int u, int v, int l, int h, int w) {
    totalCost += l * w;
    diff[u] += l;
    diff[v] -= l;
    P[psize] = Edge(v, h - l, w, e[u]);
    e[u] = &P[psize++];
    P[psize] = Edge(u, 0, -w, e[v]);
    e[v] = &P[psize++];
    updateN(u, v);
  }
  bool feasibleFlow() {
    int source = maxIndex + 1, sink = source + 1;
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      if (diff[i] < 0) {
        addEdge(source, i, 0, -diff[i], 0);
      }
      if (diff[i] > 0) {
        sum += diff[i];
        addEdge(i, sink, 0, diff[i], 0);
      }
    }
    updateN(source, sink);
    int tmpSource = S, tmpSink = T;
    addEdge(T, S, 0, INF, 0);
    isFeasibleFlow = true;
    totalCost += flow(source, sink);
    isFeasibleFlow = false;
    e[tmpSource] = e[tmpSource]->next;
    e[tmpSink] = e[tmpSink]->next;
    for (int i = 0; i < n; ++i) {
      if (diff[i] != 0) {
        e[i] = e[i]->next;
      }
    }
    return sum == maxflow;
  }
  bool maxFlow(int _S, int _T) {
    updateN(S = _S, T = _T);
    for (Edge* i = e[S]; i != NULL; i = i->next) {
      totalFlow += i->c;
    }
    if (!feasibleFlow()) {
      return false;
    }
    totalCost += flow(_S, _T);
    for (Edge* i = e[S]; i != NULL; i = i->next) {
      totalFlow -= i->c;
    }
    return true;
  }
  void gao() {
    int totalLines = 0;
    int charIndex[250];
    memset(charIndex, -1, sizeof(charIndex));
    vector<string> ret;
    char buf[1024];
    for (int i = 0; i < ::m; ++i) {
      for (Edge* j = e[i]; j != NULL; j = j->next) {
        if (j->v >= ::m && j->v < ::m + ::n && j->c == 0) {
          int var = j->v - ::m;
          charIndex[var] = i;
          ++totalLines;
          sprintf(buf, "%c=%d", (char)(i + 'a'), a[var]);
          ret.push_back(buf);
          break;
        }
      }
    }
    for (int i = 0; i < ::n; ++i) {
      ++totalLines;
      sprintf(buf, "print(%c)", (char)(charIndex[i] + 'a'));
      ret.push_back(buf);
      for (Edge* j = e[::m + ::n + i]; j != NULL; j = j->next) {
        if (j->v >= ::m && j->v < ::m + ::n && j->c == 0) {
          int var = j->v - ::m;
          charIndex[var] = charIndex[i];
          if (a[i] != a[var]) {
            ++totalLines;
            sprintf(buf, "%c=%d", (char)(charIndex[i] + 'a'), a[var]);
            ret.push_back(buf);
          }
          break;
        }
      }
    }
    printf("%d %d\n", totalLines, totalCost);
    for (vector<string>::const_iterator i = ret.begin(); i != ret.end(); ++i) {
      printf("%s\n", i->c_str());
    }
  }
} mcmf;
int main() {
  mcmf.init();
  scanf("%d%d", &n, &m);
  int S = m + n * 2, T = S + 1;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    b[i] = 0;
    for (int j = a[i]; j != 0; ++b[i], j &= j - 1)
      ;
  }
  for (int i = 0; i < m; ++i) {
    mcmf.addEdge(S, i, 0, 1, 0);
  }
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      mcmf.addEdge(i, m + j, 0, 1, b[j]);
    }
  }
  for (int i = 0; i < n; ++i) {
    mcmf.addEdge(m + i, m + n + i, 1, 1, 0);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      mcmf.addEdge(m + n + i, m + j, 0, 1, a[i] != a[j] ? b[j] : 0);
    }
  }
  for (int i = 0; i < n; ++i) {
    mcmf.addEdge(m + n + i, T, 0, 1, 0);
  }
  if (!mcmf.maxFlow(S, T)) {
    assert(false);
  }
  mcmf.gao();
  return 0;
}