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 maxn = 505, maxm = 255005;
struct edge {
  int to, next, w, cost;
} lst[maxm];
int len = 0, first[maxn];
void addedge(int a, int b, int w, int c) {
  lst[len].to = b;
  lst[len].next = first[a];
  lst[len].w = w;
  lst[len].cost = c;
  first[a] = len++;
  lst[len].to = a;
  lst[len].next = first[b];
  lst[len].w = 0;
  lst[len].cost = -c;
  first[b] = len++;
}
bool inq[maxn];
int q[maxn], dis[maxn], vis[maxn], s, t, head, tail, T, prt[maxn];
bool spfa() {
  head = tail = 0;
  vis[s] = ++T;
  dis[s] = 0;
  prt[s] = -1;
  q[tail++] = s;
  inq[s] = true;
  while (head != tail) {
    int x = q[head++];
    inq[x] = false;
    head %= maxn;
    for (int pt = first[x]; pt != -1; pt = lst[pt].next) {
      if (lst[pt].w == 0) continue;
      if (vis[lst[pt].to] != T || dis[lst[pt].to] > dis[x] + lst[pt].cost) {
        vis[lst[pt].to] = T;
        dis[lst[pt].to] = dis[x] + lst[pt].cost;
        prt[lst[pt].to] = pt;
        if (!inq[lst[pt].to]) {
          inq[lst[pt].to] = true;
          q[tail++] = lst[pt].to;
          tail %= maxn;
        }
      }
    }
  }
  return vis[t] == T;
}
int a[maxn], bits[maxn];
int n, m;
int ans1 = 0;
int mincost() {
  int cost = 0;
  while (spfa()) {
    cost += dis[t];
    for (int pt = prt[t]; pt != -1; pt = prt[lst[pt ^ 1].to]) {
      if (1 <= lst[pt].to && lst[pt].to <= n) {
        if (n < lst[pt ^ 1].to && lst[pt ^ 1].to <= 2 * n) {
          if (a[lst[pt].to] == a[lst[pt ^ 1].to - n]) {
            ans1++;
          }
        }
      }
      if (1 <= lst[pt ^ 1].to && lst[pt ^ 1].to <= n) {
        if (n < lst[pt].to && lst[pt].to <= 2 * n) {
          if (a[lst[pt ^ 1].to] == a[lst[pt].to - n]) {
            ans1--;
          }
        }
      }
      lst[pt].w--;
      lst[pt ^ 1].w++;
    }
  }
  return cost;
}
int cnt1(int x) {
  int ans = 0;
  for (; x; x >>= 1) ans += (x & 1);
  return ans;
}
int mark[maxn];
void dfs(int x, int _mark) {
  mark[x] = _mark;
  for (int pt = first[x]; pt != -1; pt = lst[pt].next) {
    if (lst[pt].to <= n * 2 && lst[pt].to >= 1 && lst[pt | 1].w == 1 &&
        mark[lst[pt].to] == 0) {
      dfs(lst[pt].to - n, _mark);
      break;
    }
  }
}
int last[maxn];
int main() {
  memset(first, -1, sizeof(first));
  scanf("%d%d", &n, &m);
  s = 0;
  t = 2 * n + 1;
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = 1; i <= n; ++i) bits[i] = cnt1(a[i]);
  for (int i = 1; i <= n; ++i) {
    addedge(s, i, 1, 0);
    addedge(n + i, t, 1, 0);
  }
  addedge(s, 2 * n + 2, m, 0);
  for (int i = 1; i <= n; ++i) {
    addedge(2 * n + 2, n + i, 1, bits[i]);
  }
  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, 0);
      else
        addedge(i, n + j, 1, bits[j]);
    }
  }
  ans1 = 2 * n;
  int ans2 = mincost();
  printf("%d %d\n", ans1, ans2);
  int tot = 0;
  for (int pt = first[2 * n + 2]; pt != -1; pt = lst[pt].next) {
    if (lst[pt].to <= 2 * n && lst[pt].to > n && lst[pt].w == 0) {
      ++tot;
      dfs(lst[pt].to - n, tot);
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!last[mark[i]]) {
      printf("%c=%d\n", 'a' + mark[i] - 1, a[i]);
      printf("print(%c)\n", 'a' + mark[i] - 1);
    } else {
      if (last[mark[i]] == a[i]) {
        printf("print(%c)\n", 'a' + mark[i] - 1);
      } else {
        printf("%c=%d\n", 'a' + mark[i] - 1, a[i]);
        printf("print(%c)\n", 'a' + mark[i] - 1);
      }
    }
    last[mark[i]] = a[i];
  }
  return 0;
}