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 = 40010;
const int Maxm = 400010;
const int inf = 1e9;
struct ZKW_flow {
  int st, ed, ecnt, n;
  int head[Maxn];
  int cap[Maxm], cost[Maxm], to[Maxm], next[Maxm];
  void init() {
    memset(head, -1, sizeof(head));
    ecnt = 2;
  }
  void add(int u, int v, int cc, int ww) {
    cap[ecnt] = cc;
    cost[ecnt] = ww;
    to[ecnt] = v;
    next[ecnt] = head[u];
    head[u] = ecnt++;
    cap[ecnt] = 0;
    cost[ecnt] = -ww;
    to[ecnt] = u;
    next[ecnt] = head[v];
    head[v] = ecnt++;
  }
  int dis[Maxn];
  void SPFA() {
    for (int i = 0; i <= n; ++i) dis[i] = inf;
    priority_queue<pair<int, int> > Q;
    dis[st] = 0;
    Q.push(make_pair(0, st));
    while (!Q.empty()) {
      int u = Q.top().second, d = -Q.top().first;
      Q.pop();
      if (dis[u] != d) continue;
      for (int p = head[u]; p != -1; p = next[p]) {
        int& v = to[p];
        if (cap[p] && dis[v] > d + cost[p]) {
          dis[v] = d + cost[p];
          Q.push(make_pair(-dis[v], v));
        }
      }
    }
    for (int i = 0; i <= n; ++i) dis[i] = dis[ed] - dis[i];
  }
  int minCost, maxFlow;
  bool use[Maxn];
  int add_flow(int u, int flow) {
    if (u == ed) {
      maxFlow += flow;
      minCost += dis[st] * flow;
      return flow;
    }
    use[u] = true;
    int now = flow;
    for (int p = head[u]; p != -1; p = next[p]) {
      int& v = to[p];
      if (cap[p] && !use[v] && dis[u] == dis[v] + cost[p]) {
        int tmp = add_flow(v, min(now, cap[p]));
        cap[p] -= tmp;
        cap[p ^ 1] += tmp;
        now -= tmp;
        if (!now) break;
      }
    }
    return flow - now;
  }
  bool modify_label() {
    int d = inf;
    for (int u = 0; u <= n; ++u)
      if (use[u])
        for (int p = head[u]; p != -1; p = next[p]) {
          int& v = to[p];
          if (cap[p] && !use[v]) d = min(d, dis[v] + cost[p] - dis[u]);
        }
    if (d == inf) return false;
    for (int i = 0; i <= n; ++i)
      if (use[i]) dis[i] += d;
    return true;
  }
  int ZKW(int ss, int tt, int nn) {
    st = ss, ed = tt, n = nn;
    minCost = maxFlow = 0;
    SPFA();
    while (true) {
      while (true) {
        for (int i = 0; i <= n; ++i) use[i] = 0;
        if (!add_flow(st, inf)) break;
      }
      if (!modify_label()) break;
    }
    return maxFlow;
  }
} G;
int a[2001];
int vis[2001], par[2001], col[2001];
queue<int> q;
int val[2001];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int src = 0;
  int ed = m + 3 * n + 5;
  G.init();
  for (int i = 1; i <= m; i++) {
    G.add(src, i, 1, 0);
    G.add(i, ed, 1, 0);
  }
  for (int i = 1; i <= n; i++) G.add(m + i, m + n + i, 1, -100000);
  for (int i = 1; i <= n; i++) G.add(m + n + i, ed, 1, 0);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      G.add(i, m + j, 1, __builtin_popcount(a[j]));
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (a[i] == a[j])
        G.add(m + n + i, m + j, 1, 0);
      else
        G.add(m + n + i, m + j, 1, __builtin_popcount(a[j]));
    }
  }
  G.ZKW(src, ed, ed + 10);
  int ans = G.minCost;
  ans += 100000 * n;
  for (int i = G.head[src]; i != -1; i = G.next[i]) {
    int x = G.to[i], y = G.cap[i];
    if (y) continue;
    vis[x] = 1;
  }
  vector<int> v, w;
  for (int i = 1; i <= m; i++)
    if (vis[i]) {
      for (int j = G.head[i]; j != -1; j = G.next[j]) {
        int x = G.to[j], y = G.cap[j];
        if (y) continue;
        if (x == src) continue;
        col[x] = i;
        v.push_back(x);
        par[x] = i;
      }
    }
  while (1) {
    if (!v.size()) break;
    w.clear();
    for (int i = 0; i < v.size(); i++) {
      int x = v[i];
      x += n;
      for (int j = G.head[x]; j != -1; j = G.next[j]) {
        int y = G.to[j], z = G.cap[j];
        if (z || y == ed) continue;
        w.push_back(y);
        col[y] = col[x - n];
      }
    }
    v.clear();
    v = w;
  }
  int X = 0;
  memset(val, 0, sizeof(val));
  for (int i = m + 1; i <= m + n; i++) {
    if (val[col[i]] == a[i - m])
      ;
    else {
      val[col[i]] = a[i - m];
      X++;
    }
  }
  printf("%d %d\n", n + X, ans);
  memset(val, 0, sizeof(val));
  for (int i = m + 1; i <= m + n; i++) {
    if (val[col[i]] == a[i - m]) {
      printf("print(%c)\n", 'a' + col[i] - 1);
    } else {
      val[col[i]] = a[i - m];
      printf("%c=%d\n", 'a' + col[i] - 1, a[i - m]);
      printf("print(%c)\n", 'a' + col[i] - 1);
    }
  }
}