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>
const int MAX = 605;
const int INF = 1000000000;
const int MOD = 1000000;
struct EDGE {
  int cap, cost, v, next;
} edge[MOD];
int head[MAX], E, q[MOD];
bool used[MAX];
int pre[MAX], cur[MAX], dis[MAX];
void add_edge(int s, int t, int cap, int cost) {
  edge[E].cap = cap;
  edge[E].cost = cost;
  edge[E].next = head[s];
  edge[E].v = t;
  head[s] = E++;
  edge[E].cap = 0;
  edge[E].cost = -cost;
  edge[E].next = head[t];
  edge[E].v = s;
  head[t] = E++;
}
int min(int a, int b) { return (a == -1 || b < a) ? b : a; }
int SPFA(int s, int t, int n) {
  int f = -1, r = 0;
  int i, v;
  q[r] = s;
  for (i = 0; i < n; i++) dis[i] = INF;
  dis[s] = 0;
  pre[s] = s;
  cur[s] = -1;
  memset(used, false, sizeof(bool) * n);
  used[s] = true;
  while (f != r) {
    f++;
    if (f >= MOD) f -= MOD;
    s = q[f];
    used[s] = false;
    for (i = head[s]; i != -1; i = edge[i].next) {
      v = edge[i].v;
      if (edge[i].cap > 0 && dis[s] + edge[i].cost < dis[v]) {
        dis[v] = dis[s] + edge[i].cost;
        pre[v] = s;
        cur[v] = i;
        if (!used[v]) {
          used[v] = true;
          r++;
          if (r >= MOD) r -= MOD;
          q[r] = v;
        }
      }
    }
  }
  return dis[t];
}
int MinCost(int s, int t, int n) {
  int ans = 0;
  int u, v, cap;
  int cost;
  while (1) {
    cost = SPFA(s, t, n);
    if (cost == INF) break;
    u = v = t;
    cap = -1;
    for (u = t; u != s; u = pre[u]) {
      cap = min(cap, edge[cur[u]].cap);
    }
    ans += cost * cap;
    u = v = t;
    for (u = t; u != s; u = pre[u]) {
      edge[cur[u]].cap -= cap;
      edge[cur[u] ^ 1].cap += cap;
    }
  }
  return ans;
}
int in[MAX];
int f[MAX];
int ch[MAX];
bool flag[MAX];
int main() {
  int n, m;
  int i, j, k;
  while (scanf("%d%d", &n, &m) != -1) {
    memset(flag, 0, sizeof(flag));
    for (i = 0; i < n; i++) {
      scanf("%d", &in[i]);
      for (j = 0, f[i] = 0; j < 31; j++)
        if (in[i] & (1 << j)) f[i]++;
    }
    int s = n * 2 + m;
    int t = s + 1;
    E = 0;
    memset(head, -1, sizeof(int) * (t + 1));
    for (i = 0; i < n; i++)
      for (j = i + 1; j < n; j++)
        add_edge(i, j + n, 1, in[i] == in[j] ? 0 : f[j]);
    for (i = 0; i < m; i++)
      for (j = 0; j < n; j++) add_edge(i + n + n, j + n, 1, f[j]);
    for (i = 0; i < n; i++) add_edge(s, i, 1, 0);
    for (i = 0; i < m; i++) add_edge(s, i + n + n, 1, 0);
    for (i = 0; i < n; i++) add_edge(i + n, t, 1, 0);
    int ans = MinCost(s, t, t + 1);
    int len = n, z = 0;
    for (i = 0; i < n; i++)
      for (j = i + 1; j < n; j++, z += 2)
        if (edge[z].cap == 0) {
          if (in[i] == in[j])
            ch[j] = i;
          else
            len++, ch[j] = i, flag[j] = 1;
        }
    for (i = 0; i < m; i++)
      for (j = 0; j < n; j++, z += 2)
        if (edge[z].cap == 0) ch[j] = i + n, len++;
    printf("%d %d\n", len, ans);
    for (i = 0; i < n; i++) {
      char c;
      if (ch[i] >= n) printf("%c=%d\n", ch[i] - n + 'a', in[i]);
      int t = i;
      while (ch[t] < n) t = ch[t];
      c = ch[t] - n + 'a';
      if (flag[i]) printf("%c=%d\n", c, in[i]);
      printf("print(%c)\n", c);
    }
  }
}