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 inf = 10000;
int c[600][600], f[600][600], w[600][600];
bool used[600];
int a[600], b[600], d[600], p[600], pd[600], numin[600], numout[600], num[600],
    col[600];
char a1[600];
int a2[600], tp[600];
inline int calc(int a) {
  int res = 0;
  while (a > 0) {
    res += (a % 2);
    a /= 2;
  }
  return res;
}
inline void add(int a, int b, int cc, int ww) {
  c[a][b] = cc;
  w[a][b] = ww;
  w[b][a] = -ww;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[i] = calc(a[i]);
  }
  int sz = 0;
  for (int i = 0; i < m; i++) {
    num[i] = sz++;
  }
  for (int i = 0; i < n; i++) {
    numin[i] = sz++;
    numout[i] = sz++;
  }
  int s = sz++;
  int t = sz++;
  int ss = sz++;
  int tt = sz++;
  for (int i = 0; i < m; i++) {
    add(s, num[i], 1, 0);
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      add(num[i], numin[j], 1, b[j]);
    }
  }
  for (int i = 0; i < n; i++) {
    add(ss, numout[i], 1, 0);
    add(numin[i], tt, 1, 0);
  }
  for (int i = 0; i < n; i++) {
    add(numout[i], t, 1, 0);
  }
  add(t, s, inf, 0);
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] == a[j]) {
        add(numout[i], numin[j], 1, 0);
      } else {
        add(numout[i], numin[j], 1, b[j]);
      }
    }
  }
  while (true) {
    for (int i = 0; i <= tt; i++) {
      d[i] = inf;
      used[i] = false;
      p[i] = -1;
    }
    d[ss] = 0;
    for (int i = 0; i <= tt; i++) {
      int v = -1;
      for (int j = 0; j <= tt; j++) {
        if (!used[j] && (v == -1 || d[j] < d[v])) {
          v = j;
        }
      }
      if (v == -1) {
        break;
      }
      used[v] = true;
      for (int j = 0; j <= tt; j++) {
        if (c[v][j] - f[v][j] > 0 && d[j] > d[v] + pd[v] + w[v][j] - pd[j]) {
          d[j] = d[v] + pd[v] + w[v][j] - pd[j];
          p[j] = v;
        }
      }
    }
    if (d[tt] == inf) {
      break;
    }
    for (int i = 0; i <= tt; i++) {
      pd[i] += d[i];
    }
    int i = tt;
    while (i != ss) {
      f[p[i]][i]++;
      f[i][p[i]]--;
      i = p[i];
    }
  }
  int ans = 0;
  for (int i = 0; i <= tt; i++) {
    for (int j = 0; j <= tt; j++) {
      ans += f[i][j] * w[i][j];
    }
  }
  ans /= 2;
  sz = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (f[num[i]][numin[j]] > 0) {
        int z = j;
        while (true) {
          col[z] = i;
          bool fl = false;
          for (int h = z + 1; h < n; h++) {
            if (f[numout[z]][numin[h]] > 0) {
              z = h;
              fl = true;
              break;
            }
          }
          if (!fl) {
            break;
          }
        }
        tp[sz] = 1;
        a1[sz] = 'a' + col[j];
        a2[sz++] = a[j];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    tp[sz] = 2;
    a1[sz++] = 'a' + col[i];
    for (int j = i + 1; j < n; j++) {
      if (f[numout[i]][numin[j]] > 0) {
        if (a[i] != a[j]) {
          tp[sz] = 1;
          a1[sz] = 'a' + col[i];
          a2[sz++] = a[j];
        }
      }
    }
  }
  printf("%d %d\n", sz, ans);
  for (int i = 0; i < sz; i++) {
    if (tp[i] == 1) {
      printf("%c=%d\n", a1[i], a2[i]);
    } else {
      printf("print(%c)\n", a1[i]);
    }
  }
  return 0;
}