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 = 1000;
const int maxm = 1000000;
const int oo = 1 << 30;
struct Edge {
  int s, e, c, nx, co;
} edge[maxm];
int head[maxn], cnt;
void add(int s, int e, int c, int co) {
  edge[cnt].s = s;
  edge[cnt].e = e;
  edge[cnt].c = c;
  edge[cnt].co = co;
  edge[cnt].nx = head[s];
  head[s] = cnt++;
  swap(s, e);
  c = 0;
  co = -co;
  edge[cnt].s = s;
  edge[cnt].e = e;
  edge[cnt].c = c;
  edge[cnt].nx = head[s];
  edge[cnt].co = co;
  head[s] = cnt++;
}
int dis[maxn];
bool in[maxn];
int pre[maxn];
queue<int> Q;
void spfa(int s) {
  for (int i = 0; i < maxn; i++) dis[i] = oo;
  memset(in, 0, sizeof(in));
  in[s] = 1;
  dis[s] = 0;
  while (!Q.empty()) Q.pop();
  Q.push(s);
  while (!Q.empty()) {
    int x = Q.front();
    Q.pop();
    in[x] = 0;
    for (int i = head[x]; ~i; i = edge[i].nx)
      if (edge[i].c) {
        int e = edge[i].e;
        if (dis[e] > dis[x] + edge[i].co) {
          dis[e] = dis[x] + edge[i].co;
          pre[e] = i;
          if (!in[e]) {
            Q.push(e);
            in[e] = 1;
          }
        }
      }
  }
}
int mincost(int s, int e) {
  int ans = 0;
  while (1) {
    spfa(s);
    if (dis[e] == oo) break;
    int now = e;
    int mi = oo;
    while (now != s) {
      mi = min(mi, edge[pre[now]].c);
      now = edge[pre[now]].s;
    }
    now = e;
    while (now != s) {
      edge[pre[now]].c -= mi;
      edge[pre[now] ^ 1].c += mi;
      now = edge[pre[now]].s;
    }
    ans += mi * dis[e];
  }
  return ans;
}
int count(int x) {
  int ans = 0;
  while (x) ans += x & 1, x >>= 1;
  return ans;
}
int n, m, a[maxn];
int id[maxn];
int NX[maxn];
int val[30];
int main() {
  while (~scanf("%d %d", &n, &m)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    cnt = 0;
    memset(head, -1, sizeof(head));
    int s = 0, t = 2 * n + 2, temp = t - 1;
    add(s, temp, m, 0);
    for (int i = 1; i <= n; i++) add(s, 2 * i - 1, 1, 0);
    for (int i = 1; i <= n; i++) add(temp, 2 * i, 1, count(a[i]));
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++) {
        int co;
        if (a[j] == a[i])
          co = 0;
        else
          co = count(a[j]);
        add(2 * i - 1, 2 * j, 1, co);
      }
    for (int i = 1; i <= n; i++) add(2 * i, t, 1, 0);
    int ans = mincost(s, t);
    memset(pre, -1, sizeof(pre));
    for (int i = head[temp]; ~i; i = edge[i].nx) {
      if (edge[i].c == 0) {
        pre[edge[i].e / 2] = 0;
      }
    }
    for (int j = 1; j <= n; j++) {
      for (int i = head[2 * j - 1]; ~i; i = edge[i].nx) {
        if (edge[i].c == 0) {
          pre[edge[i].e / 2] = j;
        }
      }
    }
    int cao = 0;
    int use = 0;
    memset(val, -1, sizeof(val));
    for (int i = 1; i <= n; i++) {
      if (pre[i] == 0)
        id[i] = use++;
      else
        id[i] = id[pre[i]];
      if (a[i] != val[id[i]]) cao++;
      val[id[i]] = a[i];
      cao++;
    }
    printf("%d %d\n", cao, ans);
    use = 0;
    memset(val, -1, sizeof(val));
    for (int i = 1; i <= n; i++) {
      if (pre[i] == 0)
        id[i] = use++;
      else
        id[i] = id[pre[i]];
      if (a[i] != val[id[i]]) printf("%c=%d\n", id[i] + 'a', a[i]);
      val[id[i]] = a[i];
      printf("print(%c)\n", id[i] + 'a');
    }
  }
}