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 = 601;
const int inf = 1 << 30;
struct edge {
  int v, w, c, rev;
  edge() {}
  edge(int v, int w, int c, int rev) : v(v), w(w), c(c), rev(rev) {}
};
vector<edge> adj[maxn];
pair<int, int> p[maxn];
int dis[maxn];
int extra[maxn];
int a[maxn];
int cst[maxn];
int pos[maxn][maxn];
int pst[maxn];
int vis[maxn];
bool f[maxn];
int spfa(int s, int t);
int ek(int s, int t);
void add(int u, int v, int w, int c);
void add(int u, int v, int l, int r, int c);
int val(int x);
int main() {
  int n, m;
  int s, t, S, T, r;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cst[i] = val(a[i]);
  }
  S = 0;
  T = 2 * n + 4;
  s = 1;
  t = 2 * n + 3;
  r = 2 * n + 2;
  add(s, r, m, 0);
  for (int i = 1; i <= n; i++) {
    int u = 2 * i;
    int v = 2 * i + 1;
    add(r, u, 1, cst[i]);
    add(u, v, 1, 1, 0);
    add(v, t, 1, 0);
    for (int j = i + 1; j <= n; j++) {
      int u1 = 2 * j;
      if (a[i] == a[j])
        add(v, u1, 1, 0);
      else
        add(v, u1, 1, cst[j]);
      pos[i][j] = adj[v].size() - 1;
    }
  }
  add(t, s, inf, 0);
  for (int i = 1; i <= n; i++) {
    int u = 2 * i;
    int v = 2 * i + 1;
    add(u, T, -extra[u], 0);
    add(S, v, extra[v], 0);
  }
  int cost = ek(S, T);
  for (int i = 1; i <= n; i++) {
    int v = 2 * i + 1;
    for (int j = i + 1; j <= n; j++) {
      if (!adj[v][pos[i][j]].w) {
        pst[i] = j;
      }
    }
  }
  int cnt = 0;
  int line = n;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    f[i] = 1;
    vis[i] = ++cnt;
    int last = i;
    int cur = pst[i];
    line++;
    while (cur) {
      if (a[cur] != a[last]) line++;
      vis[cur] = vis[i];
      last = cur;
      cur = pst[cur];
    }
  }
  printf("%d %d\n", line, cost);
  for (int i = 1; i <= n; i++) {
    if (!f[i]) continue;
    char key = 'a' + vis[i] - 1;
    printf("%c=%d\n", key, a[i]);
  }
  for (int i = 1; i <= n; i++) {
    char key = 'a' + vis[i] - 1;
    printf("print(%c)\n", key);
    if (pst[i] && a[i] != a[pst[i]]) {
      printf("%c=%d\n", key, a[pst[i]]);
    }
  }
  return 0;
}
int spfa(int s, int t) {
  for (int i = s; i <= t; i++) {
    dis[i] = inf;
  }
  dis[s] = 0;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < adj[u].size(); i++) {
      int v = adj[u][i].v;
      int w = adj[u][i].w;
      int c = adj[u][i].c;
      if (w <= 0) continue;
      if (dis[v] <= dis[u] + c) continue;
      dis[v] = dis[u] + c;
      q.push(v);
      p[v] = make_pair(u, i);
    }
  }
  if (dis[t] == inf) return 0;
  int cur = t;
  int flow = inf;
  while (cur != s) {
    int u = p[cur].first;
    int i = p[cur].second;
    flow = min(flow, adj[u][i].w);
    cur = u;
  }
  cur = t;
  while (cur != s) {
    int u = p[cur].first;
    int i = p[cur].second;
    int rev = adj[u][i].rev;
    adj[u][i].w -= flow;
    adj[cur][rev].w += flow;
    cur = u;
  }
  return flow;
}
int ek(int s, int t) {
  int cost = 0;
  int flow = 0;
  while (int df = spfa(s, t)) {
    flow += df;
    cost += df * dis[t];
  }
  return cost;
}
void add(int u, int v, int w, int c) {
  adj[u].push_back(edge(v, w, c, adj[v].size()));
  adj[v].push_back(edge(u, 0, -c, adj[u].size() - 1));
}
void add(int u, int v, int l, int r, int c) {
  if (r - l) add(u, v, r - l, c);
  extra[u] -= l;
  extra[v] += l;
}
int val(int x) {
  int ret = 0;
  for (int i = 0; i <= 30; i++) {
    if ((x >> i) & 1) ret++;
  }
  return ret;
}