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 = 1200;
const int maxm = 30;
const int maxl = 10000;
const int inf = 1100000000;
const int maxe = 710000;
const int bigv = 30000;
int n, m, a[maxn];
int L, C, S, T;
int calc(int x) {
  int ret = 0;
  for (x; x; x = x >> 1) ret += x & 1;
  return ret;
}
struct edge {
  int t, nxt, c, v;
} e[maxe];
int head[maxn], cntedge;
void addedge(int f, int t, int v, int c) {
  e[cntedge].t = t;
  e[cntedge].v = v;
  e[cntedge].c = c;
  e[cntedge].nxt = head[f];
  head[f] = cntedge++;
  e[cntedge].t = f;
  e[cntedge].v = 0;
  e[cntedge].c = -c;
  e[cntedge].nxt = head[t];
  head[t] = cntedge++;
}
int dis[maxn], pre[maxn];
bool vis[maxn], inq[maxn];
queue<int> Q;
bool SPFA(int s, int t) {
  while (!Q.empty()) Q.pop();
  memset(vis, 0, sizeof vis);
  memset(inq, 0, sizeof inq);
  dis[s] = 0;
  vis[s] = 1;
  inq[s] = 1;
  pre[s] = -1;
  Q.push(s);
  while (!Q.empty()) {
    int now = Q.front();
    Q.pop();
    inq[now] = 0;
    for (int tg = head[now]; tg >= 0; tg = e[tg].nxt) {
      if (e[tg].v) {
        if ((!vis[e[tg].t]) || (dis[e[tg].t] < dis[now] + e[tg].c)) {
          vis[e[tg].t] = 1;
          dis[e[tg].t] = dis[now] + e[tg].c;
          pre[e[tg].t] = tg;
          if (!inq[e[tg].t]) {
            inq[e[tg].t] = 1;
            Q.push(e[tg].t);
          }
        }
      }
    }
  }
  return vis[t];
}
int ansv, ansc;
void maxflow(int S, int T) {
  ansv = ansc = 0;
  int f1, c1, p;
  while (SPFA(S, T)) {
    f1 = inf;
    c1 = dis[T];
    for (p = T; p ^ S; p = e[pre[p] ^ 1].t) f1 = min(f1, e[pre[p]].v);
    ansv += f1;
    ansc += c1 * f1;
    for (p = T; p ^ S; p = e[pre[p] ^ 1].t) {
      e[pre[p]].v -= f1;
      e[pre[p] ^ 1].v += f1;
    }
  }
}
bool used[maxn], reserve[maxn], call[maxn];
int var[maxn];
int path[maxn];
void initial() {
  cntedge = 0;
  memset(head, -1, sizeof head);
  memset(path, -1, sizeof path);
}
int main() {
  initial();
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    C += calc(a[i]);
  }
  for (int i = 1; i <= n; i++) addedge(i, i + n, 1, bigv);
  S = n + n + 1;
  T = n + n + 2;
  int tt = n + n + 3;
  addedge(S, 1, m, 0);
  for (int i = 2; i <= n; i++) addedge(i - 1 + n, i, 1, 0);
  addedge(n + n, tt, 1, 0);
  for (int i = 2; i <= n; i++) addedge(i - 1, i, m, 0);
  addedge(n, tt, m, 0);
  addedge(tt, T, m, 0);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (a[i] == a[j]) {
        addedge(i + n, j, 1, calc(a[i]));
        path[i] = cntedge - 1;
        break;
      }
  maxflow(S, T);
  C = C - ansc + n * bigv;
  L = n + n;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (path[i] >= 0) {
      if (e[path[i]].v) {
        reserve[i] = 1;
        call[e[path[i] ^ 1].t] = 1;
        L--;
      }
    }
  }
  printf("%d %d\n", L, C);
  memset(used, 0, sizeof used);
  memset(var, 0, sizeof var);
  for (int i = 1; i <= n; i++) {
    if (call[i]) {
      for (int j = 0; j < m; j++)
        if (a[var[j]] == a[i] && reserve[var[j]]) {
          var[j] = i;
          printf("print(%c)\n", 'a' + j);
          break;
        }
    } else {
      for (int j = 0; j < m; j++) {
        if (!var[j] || !reserve[var[j]]) {
          var[j] = i;
          printf("%c=%d\n", 'a' + j, a[i]);
          printf("print(%c)\n", 'a' + j);
          break;
        }
      }
    }
  }
  return 0;
}