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 = 520;
const int INF = 1000000000;
int mat[MAXN][MAXN], cost[MAXN][MAXN], flow[MAXN][MAXN];
int a[500], b[500];
int getV(int x) {
  int t = 0;
  while (x) {
    t += (x % 2);
    x /= 2;
  }
  return t;
}
int minCostMaxFlow(int n, const int mat[][MAXN], int cost[][MAXN], int source,
                   int sink, int flow[][MAXN], int& netcost) {
  int pre[MAXN], min[MAXN], d[MAXN], i, j, t, tag;
  if (source == sink) {
    return INF;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; flow[i][j++] = 0)
      ;
  }
  for (netcost = 0;;) {
    for (i = 0; i < n; i++) {
      pre[i] = 0;
      min[i] = INF;
    }
    pre[source] = source + 1;
    min[source] = 0;
    d[source] = INF;
    for (tag = 1; tag;) {
      for (tag = t = 0; t < n; t++) {
        if (d[t]) {
          for (i = 0; i < n; i++) {
            if ((j = mat[t][i] - flow[t][i]) && min[t] + cost[t][i] < min[i]) {
              tag = 1;
              min[i] = min[t] + cost[t][i];
              pre[i] = t + 1;
              d[i] = d[t] < j ? d[t] : j;
            } else if ((j = flow[i][t]) && min[t] < INF &&
                       min[t] - cost[i][t] < min[i]) {
              tag = 1;
              min[i] = min[t] - cost[i][t];
              pre[i] = -t - 1;
              d[i] = d[t] < j ? d[t] : j;
            }
          }
        }
      }
    }
    if (!pre[sink]) {
      break;
    }
    for (netcost += min[sink] * d[i = sink]; i != source;) {
      if (pre[i] > 0) {
        flow[pre[i] - 1][i] += d[sink];
        i = pre[i] - 1;
      } else {
        flow[i][-pre[i] - 1] -= d[sink];
        i = -pre[i] - 1;
      }
    }
  }
  for (j = i = 0; i < n; j += flow[source][i++])
    ;
  return j;
}
int main() {
  int i, j, k, m, n, netcost;
  while (cin >> n >> m) {
    for (i = 1; i <= n; ++i) {
      scanf("%d", &a[i]);
      b[i] = getV(a[i]);
    }
    memset(mat, 0, sizeof(mat));
    memset(cost, 0, sizeof(cost));
    mat[0][2 * n + 1] = m;
    for (i = 1; i <= n; ++i) {
      mat[0][i] = 1;
      mat[2 * n + 1][n + i] = 1;
      cost[2 * n + 1][n + i] = b[i];
      mat[n + i][2 * n + 2] = 1;
      for (j = i + 1; j <= n; ++j) {
        mat[i][j + n] = 1;
        if (a[i] == a[j])
          cost[i][j + n] = 0;
        else
          cost[i][j + n] = b[j];
      }
    }
    minCostMaxFlow(2 * n + 3, mat, cost, 0, 2 * n + 2, flow, netcost);
    int nn = 0, val[30], ans[260], res = 0, len = 0;
    for (i = 1; i <= n; ++i) {
      if (flow[2 * n + 1][n + i] == 1) {
        res += b[i];
        ++len;
      } else {
        for (j = 1;; ++j) {
          if (flow[j][n + i] == 1) break;
        }
        if (a[j] != a[i]) {
          ++len;
          res += b[i];
        }
      }
    }
    cout << len + n << " " << res << endl;
    for (i = 1; i <= n; ++i) {
      if (flow[2 * n + 1][n + i] == 1) {
        ans[i] = nn++;
        printf("%c=%d\n", 'a' + ans[i], a[i]);
        printf("print(%c)\n", 'a' + ans[i]);
      } else {
        for (j = 1;; ++j) {
          if (flow[j][n + i] == 1) break;
        }
        ans[i] = ans[j];
        if (a[j] != a[i]) {
          printf("%c=%d\n", 'a' + ans[i], a[i]);
          printf("print(%c)\n", 'a' + ans[i]);
        } else
          printf("print(%c)\n", 'a' + ans[i]);
      }
    }
  }
}