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;
char buf[1 << 20], *p1, *p2;
template <class T>
inline void read(T &n) {
  char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
           ? 0
           : *p1++);
  T w = 1, x = 0;
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
             ? 0
             : *p1++);
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
             ? 0
             : *p1++);
  }
  n = x * w;
}
const int maxn = 605;
const int maxm = 100005;
const int inf = 0x3f3f3f3f;
int n, m, st, ed, ss, tt, a[maxn], b[maxn];
int last[maxn], Next[maxm << 1], to[maxm << 1], w[maxm << 1], dis[maxm << 1],
    cnt = 1;
inline void addedge(int x, int y, int z, int d) {
  Next[++cnt] = last[x], last[x] = cnt;
  to[cnt] = y, w[cnt] = z, dis[cnt] = d;
}
inline void add(int x, int y, int z, int d) {
  addedge(x, y, z, d), addedge(y, x, 0, -d);
}
queue<int> Q;
int Dis[maxn], flow[maxn], vis[maxn], pre[maxn];
bool spfa() {
  memset(Dis, 0x3f, sizeof(Dis));
  Dis[st] = pre[ed] = 0;
  flow[st] = inf;
  Q.push(st);
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop(), vis[u] = 0;
    for (int i = last[u]; i; i = Next[i]) {
      int v = to[i];
      if (w[i] && Dis[u] + dis[i] < Dis[v]) {
        Dis[v] = Dis[u] + dis[i];
        flow[v] = min(flow[u], w[i]);
        if (!vis[v]) Q.push(v), vis[v] = 1;
        pre[v] = i;
      }
    }
  }
  return pre[ed];
}
int EK() {
  int res = 0;
  while (spfa()) {
    res += Dis[ed] * flow[ed];
    for (int i = ed; i != st; i = to[pre[i] ^ 1]) {
      w[pre[i]] -= flow[ed];
      w[pre[i] ^ 1] += flow[ed];
    }
  }
  return res;
}
int bel[maxn], opt[maxm], num[maxm], orz[maxm];
int main() {
  read(n), read(m), tt = n * 2 + m + 1;
  for (int i = 1; i <= n; i++) {
    read(a[i]);
    b[i] = __builtin_popcount(a[i]);
  }
  for (int i = 1; i <= m; i++) add(ss, i, 1, 0), add(i, tt, 1, 0);
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) add(i, j + m, 1, b[j]);
  for (int i = 1; i <= n; i++) add(i + m + n, ed, 1, 0);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (a[i] == a[j])
        add(i + m + n, j + m, 1, 0);
      else
        add(i + m + n, j + m, 1, b[j]);
    }
  st = tt + 1, ed = st + 1;
  for (int i = 1; i <= n; i++) {
    add(i + m, ed, 1, 0);
    add(st, i + m + n, 1, 0);
  }
  add(tt, ss, inf, 0);
  int ans = EK();
  int tot = 0;
  for (int x = m + 1; x <= m + n; x++) {
    for (int i = last[x]; i; i = Next[i]) {
      if (!w[i]) continue;
      int v = to[i];
      if (v <= m) {
        bel[x - m] = v;
        opt[++tot] = 0, num[tot] = v, orz[tot] = a[x - m];
      } else {
        bel[x - m] = bel[v - n - m];
        if (a[x - m] != a[v - n - m])
          opt[++tot] = 0, num[tot] = bel[x - m], orz[tot] = a[x - m];
      }
    }
    opt[++tot] = 1, num[tot] = bel[x - m];
  }
  cout << tot << " " << ans << endl;
  for (int i = 1; i <= tot; i++) {
    if (opt[i] == 0)
      printf("%c=%d\n", (char)(num[i] + 'a' - 1), orz[i]);
    else
      printf("print(%c)\n", (char)(num[i] + 'a' - 1));
  }
  return 0;
}