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;
int n, m, num[500], s, t, deg[100100];
inline void read(int &x) {
  x = 0;
  register char c = getchar();
  while (c > '9' || c < '0') c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
}
namespace MCMF {
const int N = 100000, M = 2000000;
int head[N], cnt, dis[N], fr[N], id[N], S, T, cost, flow;
struct node {
  int to, next, val, cost;
} edge[M];
inline void ae(int u, int v, int w, int c) {
  edge[cnt].cost = c, edge[cnt].next = head[u], edge[cnt].to = v,
  edge[cnt].val = w, head[u] = cnt++;
  edge[cnt].cost = -c, edge[cnt].next = head[v], edge[cnt].to = u,
  edge[cnt].val = 0, head[v] = cnt++;
}
queue<int> q;
bool in[N];
inline bool SPFA() {
  memset(dis, 0x3f, sizeof(dis)), dis[S] = 0, q.push(S), in[S] = true;
  while (!q.empty()) {
    register int x = q.front();
    q.pop(), in[x] = false;
    for (register int i = head[x]; i != -1; i = edge[i].next) {
      if (!edge[i].val) continue;
      if (dis[edge[i].to] > dis[x] + edge[i].cost) {
        dis[edge[i].to] = dis[x] + edge[i].cost, fr[edge[i].to] = x,
        id[edge[i].to] = i;
        if (!in[edge[i].to]) in[edge[i].to] = true, q.push(edge[i].to);
      }
    }
  }
  if (dis[T] == 0x3f3f3f3f) return false;
  int x = T, mn = 0x3f3f3f3f;
  while (x != S) mn = min(mn, edge[id[x]].val), x = fr[x];
  cost += dis[T] * mn, x = T, flow += mn;
  while (x != S) edge[id[x]].val -= mn, edge[id[x] ^ 1].val += mn, x = fr[x];
  return true;
}
}  // namespace MCMF
using namespace MCMF;
vector<pair<int, int> > res;
stack<int> bin;
map<int, int> val;
int main() {
  read(n), read(m), memset(head, -1, sizeof(head));
  for (register int i = 0; i < n; i++) read(num[i]);
  s = n * 3, t = n * 3 + 1, S = n * 3 + 2, T = n * 3 + 3;
  for (register int i = 0; i < n; i++) {
    ae(i, i + n, 1, __builtin_popcount(num[i]));
    deg[i + n]--, deg[i + 2 * n]++;
    ae(i + 2 * n, i == n - 1 ? t : i + 1, 1, 0);
    for (int j = i + 1; j < n; j++)
      if (num[j] == num[i]) {
        ae(i + 2 * n, j + n, 1, 0);
        break;
      }
  }
  ae(s, 0, m, 0), ae(n - 1, t, m, 0);
  for (int i = 0; i < n - 1; i++) ae(i, i + 1, m, 0);
  ae(t, s, 0x3f3f3f3f, 0);
  for (register int i = 0; i <= t; i++) {
    if (deg[i] > 0) ae(S, i, deg[i], 0);
    if (deg[i] < 0) ae(i, T, -deg[i], 0);
  }
  while (SPFA())
    ;
  for (register int i = 0; i < m; i++) bin.push(i);
  for (register int i = 0; i < n; i++) val[num[i]] = -1;
  for (int i = 0; i < n; i++) {
    for (int j = head[i]; j != -1; j = edge[j].next)
      if (edge[j].to == i + n && !edge[j].val)
        res.push_back(make_pair(bin.top(), num[i])), val[num[i]] = bin.top(),
                                                     bin.pop();
    res.push_back(make_pair(-1, val[num[i]]));
    for (int j = head[i + 2 * n]; j != -1; j = edge[j].next)
      if (edge[j].to == (i == n - 1 ? t : i + 1) && !edge[j].val)
        bin.push(val[num[i]]), val[num[i]] = -1;
  }
  printf("%d %d\n", res.size(), cost);
  for (register int i = 0; i < res.size(); i++)
    if (res[i].first == -1)
      printf("print(%c)\n", 'a' + res[i].second);
    else
      printf("%c=%d\n", 'a' + res[i].first, res[i].second);
  return 0;
}