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 N = 300;
int data[N], xx[N];
vector<pair<int, int> > V;
int id[1005][1005];
template <class U, class V>
struct MCMF {
  static const int N = 800, M = 400000, inf = 0x3fffffff;
  int h[N], ing[N], pre[N], to[M], ne[M], e, s, t, n;
  U cap[M];
  V dis[N], cost[M];
  void ini(int _n = N) {
    fill(h, h + (n = _n), -1);
    e = 0;
  }
  void liu(int u, int v, U c, V w) {
    to[e] = v;
    ne[e] = h[u];
    cap[e] = c;
    cost[e] = w;
    id[u][v] = e;
    h[u] = e++;
  }
  void link(int u, int v, U c, V w) {
    liu(u, v, c, w);
    liu(v, u, 0, -w);
  }
  bool spfa() {
    queue<int> Q;
    fill(dis, dis + n, inf);
    ing[s] = true, dis[s] = 0;
    Q.push(s);
    while (!Q.empty()) {
      int c = Q.front();
      Q.pop();
      ing[c] = false;
      for (int k = h[c]; ~k; k = ne[k]) {
        int v = to[k];
        if (cap[k] <= 0) continue;
        if (dis[c] + cost[k] < dis[v]) {
          dis[v] = dis[c] + cost[k];
          pre[v] = k;
          if (!ing[v]) Q.push(v), ing[v] = true;
        }
      }
    }
    return dis[t] != inf;
  }
  U flow;
  V mincost;
  pair<U, V> run(int _s, int _t) {
    s = _s, t = _t;
    flow = mincost = 0;
    while (spfa()) {
      U pl = inf;
      int p, k;
      for (p = t; p != s; p = to[k ^ 1]) pl = min(pl, cap[k = pre[p]]);
      for (p = t; p != s; p = to[k ^ 1]) {
        k = pre[p];
        cap[k] -= pl;
        cap[k ^ 1] += pl;
      }
      mincost += pl * dis[t];
      flow += pl;
    }
    return make_pair(flow, mincost);
  }
  int ask(int id) { return cap[id ^ 1]; }
};
MCMF<int, int> G;
int cost(int a) {
  int ans = 0;
  while (a) ans++, a &= (a - 1);
  return ans;
}
vector<int> v;
int main() {
  G.ini();
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (n); ++i) {
    scanf("%d", &data[i]);
    v.push_back(data[i]);
  }
  sort((v).begin(), (v).end());
  v.erase(unique((v).begin(), (v).end()), v.end());
  if (((int)(v).size()) <= m) {
    int f[30] = {0}, C = 0;
    for (int i = (0); i < (((int)(v).size())); ++i) C += cost(v[i]);
    cout << n + ((int)(v).size()) << " " << C << "\n";
    for (int i = (0); i < (n); ++i) {
      int p = lower_bound((v).begin(), (v).end(), data[i]) - v.begin();
      if (!f[p]) printf("%c=%d\n", p + 'a', data[i]);
      f[p] = 1;
      printf("print(%c)\n", p + 'a');
    }
    return 0;
  }
  for (int i = (1); i < (m + 1); ++i) G.link(0, i, 1, 0);
  for (int i = (1); i < (m + 1); ++i)
    for (int j = (0); j < (n); ++j) G.link(i, j * 2 + 30, 1, cost(data[j]));
  for (int j = (0); j < (n); ++j) G.link(j * 2 + 30, j * 2 + 31, 1, -100000);
  for (int i = (0); i < (n); ++i)
    for (int j = (i + 1); j < (n); ++j)
      G.link(i * 2 + 31, j * 2 + 30, 1, data[i] == data[j] ? 0 : cost(data[j]));
  for (int i = (0); i < (n); ++i) G.link(i * 2 + 31, n * 2 + 30, 1, 0);
  pair<int, int> res = G.run(0, n * 2 + 30);
  for (int i = (0); i < (n); ++i) {
    for (int j = (1); j < (m + 1); ++j)
      if (G.ask(id[j][i * 2 + 30])) V.push_back(make_pair(j, i)), xx[i] = j;
    for (int j = (0); j < (i); ++j)
      if (G.ask(id[j * 2 + 31][i * 2 + 30])) {
        xx[i] = xx[j];
        if (data[i] != data[j]) V.push_back(make_pair(xx[j], i));
      }
    V.push_back(make_pair(0, xx[i]));
  }
  cout << ((int)(V).size()) << " " << res.second + n * 100000 << "\n";
  for (int i = (0); i < (((int)(V).size())); ++i) {
    if (V[i].first == 0)
      printf("print(%c)\n", V[i].second + 'a' - 1);
    else
      printf("%c=%d\n", V[i].first + 'a' - 1, data[V[i].second]);
  }
  return 0;
}