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 = 10005;
const int MAXM = 500005;
const int INF = 1e9;
int pre[MAXN], dis[MAXN];
int po[MAXN], tol;
bool use[MAXN];
int q[MAXM], head, tail;
int n, m, vs, vt, ans;
struct node {
  int y, f, cost, next;
} edge[MAXM];
void Add(int x, int y, int f, int cost) {
  edge[++tol].y = y;
  edge[tol].f = f;
  edge[tol].cost = cost;
  edge[tol].next = po[x];
  po[x] = tol;
}
void add(int x, int y, int f, int cost) {
  Add(x, y, f, cost);
  Add(y, x, 0, -cost);
}
bool spfa() {
  memset(use, false, sizeof(use));
  for (int i = 1; i <= vt; i++) dis[i] = INF;
  dis[vs] = 0;
  head = tail = 0;
  q[tail++] = vs;
  pre[vs] = 0;
  while (head < tail) {
    int x = q[head++];
    use[x] = false;
    for (int i = po[x]; i; i = edge[i].next) {
      int y = edge[i].y;
      if (edge[i].f > 0 && edge[i].cost + dis[x] < dis[y]) {
        dis[y] = dis[x] + edge[i].cost;
        pre[y] = i;
        if (!use[y]) {
          use[y] = true;
          q[tail++] = y;
        }
      }
    }
  }
  if (dis[vt] == INF) return false;
  int aug = INF;
  for (int i = pre[vt]; i; i = pre[edge[i ^ 1].y]) aug = min(aug, edge[i].f);
  for (int i = pre[vt]; i; i = pre[edge[i ^ 1].y]) {
    edge[i].f -= aug;
    edge[i ^ 1].f += aug;
  }
  ans += dis[vt] * aug;
  return true;
}
int a[MAXN];
int cnt(int x) {
  int ans = 0;
  while (x) {
    ans += x & 1;
    x >>= 1;
  }
  return ans;
}
string vec[MAXN];
int fa[MAXN];
string cc(int n) {
  string s;
  while (n) {
    s.push_back(char(n % 10 + '0'));
    n /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
int tmp[MAXN];
int val[MAXN];
int main() {
  int ncase = 0;
  while (cin >> n >> m) {
    ncase ? puts("------------------------") : ncase = 1;
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    memset(po, 0, sizeof(po));
    tol = 1;
    vs = MAXN - 5;
    vt = vs + 1;
    for (int i = 1; i <= n; i++) {
      add(vs, i, 1, 0);
      for (int j = i + 1; j <= n; j++)
        add(i, j + n, 1, a[i] == a[j] ? 0 : cnt(a[j]));
      add(i + n, vt, 1, 0);
    }
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= n; j++) add(i + 2 * n, j + n, 1, cnt(a[j]));
      add(vs, i + 2 * n, 1, 0);
    }
    ans = 0;
    while (spfa())
      ;
    memset(val, 0, sizeof(val));
    for (int i = 2; i <= tol; i += 2) {
      int x = edge[i].y;
      int y = edge[i ^ 1].y;
      if (x == vs || y == vs || x == vt || y == vt) continue;
      if (edge[i].f) continue;
      fa[x] = y;
    }
    int top = 0;
    for (int i = 1; i <= n; i++) {
      int x = i + n;
      int y = fa[x];
      if (y > 2 * n) {
        string s;
        s.push_back(char('a' + y - 2 * n - 1));
        s += "=" + cc(a[i]);
        vec[top++] = s;
        s.clear();
        s = "print(";
        s.push_back(char('a' + y - 2 * n - 1));
        vec[top++] = s + ")";
        val[i] = y - 2 * n - 1;
        tmp[val[i]] = a[i];
      } else {
        string s;
        if (tmp[val[y]] == a[i]) {
          val[i] = val[y];
          s = "print(";
          s.push_back(char('a' + val[y]));
          vec[top++] = s + ")";
        } else {
          s.push_back(char('a' + val[y]));
          s += "=" + cc(a[i]);
          vec[top++] = s;
          s.clear();
          s = "print(";
          s.push_back(char('a' + val[y]));
          vec[top++] = s + ")";
          val[i] = val[y];
          tmp[val[i]] = a[i];
        }
      }
    }
    cout << top << " " << ans << endl;
    for (int i = 0; i < top; i++) cout << vec[i] << endl;
  }
  return 0;
}