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 = 500 + 10;
const int M = N * N * 2 + 10;
const int INF = 0x3f3f3f3f;
struct Edge {
  int u, v, next, cap, cost;
  Edge(int u = -1, int v = -1, int next = -1, int cap = -1, int cost = -1)
      : u(u), v(v), next(next), cap(cap), cost(cost) {}
} e[M];
int head[N], total;
void init() {
  total = 0;
  memset(head, -1, sizeof(head));
}
void adde(int u, int v, int cap, int cost) {
  e[total] = Edge(u, v, head[u], cap, cost);
  head[u] = total++;
  e[total] = Edge(v, u, head[v], 0, -cost);
  head[v] = total++;
}
int dis[N], vis[N];
int path[N], low[N];
int Spfa(int s, int t) {
  memset(vis, 0, sizeof(vis));
  memset(dis, 0x3f, sizeof(dis));
  memset(low, 0, sizeof(low));
  queue<int> qq;
  qq.push(s);
  vis[s] = 1;
  low[s] = INF;
  dis[s] = 0;
  while (!qq.empty()) {
    int u = qq.front();
    qq.pop();
    vis[u] = 0;
    for (int i = head[u]; i != -1; i = e[i].next) {
      int v = e[i].v;
      if (e[i].cap > 0 && (dis[v] > dis[u] + e[i].cost)) {
        path[v] = i;
        low[v] = min(low[u], e[i].cap);
        dis[v] = dis[u] + e[i].cost;
        if (!vis[v]) {
          vis[v] = 1;
          qq.push(v);
        }
      }
    }
  }
  return low[t];
}
int mcmf(int s, int t) {
  int flow = 0;
  int cost = 0;
  while (Spfa(s, t)) {
    int f = low[t];
    for (int i = t; i != s; i = e[path[i]].u) {
      e[path[i]].cap -= f;
      e[path[i] ^ 1].cap += f;
    }
    flow += f;
    cost += dis[t] * f;
  }
  return cost;
}
int aa[N];
int n, m;
int pre[N], last[N];
char ch[N];
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &aa[i]);
    init();
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        int k = aa[j];
        int cnt = 0;
        while (k) {
          if (k & 1) cnt++;
          k /= 2;
        }
        if (aa[i] != aa[j])
          adde(i, j + n, 1, cnt);
        else
          adde(i, j + n, 1, 0);
      }
    }
    adde(0, 2 * n + 1, m, 0);
    for (int i = 1; i <= n; i++) {
      adde(0, i, 1, 0);
      adde(n + i, 2 * n + 2, 1, 0);
      int j = aa[i], cnt = 0;
      while (j) {
        if (j & 1) cnt++;
        j /= 2;
      }
      adde(2 * n + 1, n + i, 1, cnt);
    }
    int xx = mcmf(0, 2 * n + 2);
    memset(last, 0, sizeof(last));
    memset(pre, 0, sizeof(pre));
    for (int i = 1; i <= n; i++) {
      for (int j = head[i]; j != -1; j = e[j].next) {
        if (e[j].v > n && e[j].cap == 0) {
          last[i] = e[j].v - n;
          pre[e[j].v - n] = i;
        }
      }
    }
    char top = 'a';
    for (int i = 1; i <= n; i++) {
      if (pre[i] == 0) ch[i] = top++;
    }
    int yy = 0;
    for (int i = 1; i <= n; i++) {
      if (pre[i] == 0 || aa[pre[i]] != aa[i]) {
        yy++;
      }
      yy++;
      if (last[i]) {
        ch[last[i]] = ch[i];
      }
    }
    printf("%d %d\n", yy, xx);
    for (int i = 1; i <= n; i++) {
      if (pre[i] == 0 || aa[pre[i]] != aa[i]) {
        printf("%c=%d\n", ch[i], aa[i]);
      }
      printf("print(%c)\n", ch[i]);
      if (last[i]) {
        ch[last[i]] = ch[i];
      }
    }
  }
  return 0;
}