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;
struct Edge {
  int s, e, c, nx, co;
} road[1000000];
int head[1000], cnt, dis[1000], pre[1000], n, m, a[1000], id[1000];
int val[30];
bool in[1000];
queue<int> Q;
void add(int s, int e, int c, int co) {
  road[cnt].s = s;
  road[cnt].e = e;
  road[cnt].c = c;
  road[cnt].co = co;
  road[cnt].nx = head[s];
  head[s] = cnt++;
  swap(s, e);
  c = 0;
  co = -co;
  road[cnt].s = s;
  road[cnt].e = e;
  road[cnt].c = c;
  road[cnt].nx = head[s];
  road[cnt].co = co;
  head[s] = cnt++;
}
void spfa(int s) {
  for (int i = 0; i < 1000; i++) dis[i] = 0x3f3f3f3f;
  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 = road[i].nx)
      if (road[i].c) {
        int e = road[i].e;
        if (dis[e] > dis[x] + road[i].co) {
          dis[e] = dis[x] + road[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] == 0x3f3f3f3f) break;
    int now = e;
    int mi = 0x3f3f3f3f;
    while (now != s) {
      mi = min(mi, road[pre[now]].c);
      now = road[pre[now]].s;
    }
    now = e;
    while (now != s) {
      road[pre[now]].c -= mi;
      road[pre[now] ^ 1].c += mi;
      now = road[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 main() {
  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 = road[i].nx) {
    if (road[i].c == 0) {
      pre[road[i].e / 2] = 0;
    }
  }
  for (int j = 1; j <= n; j++) {
    for (int i = head[2 * j - 1]; ~i; i = road[i].nx) {
      if (road[i].c == 0) {
        pre[road[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');
  }
  return 0;
}