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 = 252, MAXM = 28;
int V, E;
int cap[85000], flow[85000];
int cost[85000], dist[540], pot[540];
int to[85000], prv[85000], last[540], path[540];
bool used[540];
priority_queue<pair<int, int> > q;
class MinCostFlow {
 public:
  MinCostFlow(int n);
  void add_edge(int x, int y, int w, int c);
  pair<int, int> search(int s, int t);
  pair<int, int> mincostflow(int s, int t);
  vector<pair<int, int> > flow_edges(void);
};
vector<pair<int, int> > MinCostFlow::flow_edges(void) {
  int x, e;
  vector<pair<int, int> > ans;
  for ((x) = 0; (x) < (int)(V); (x)++)
    for (e = last[x]; e >= 0; e = prv[e])
      if (flow[e] > 0) ans.push_back(make_pair(x, to[e]));
  return ans;
}
MinCostFlow::MinCostFlow(int n) {
  V = n;
  E = 0;
  int i;
  for ((i) = 0; (i) < (int)(V); (i)++) last[i] = -1;
}
void MinCostFlow::add_edge(int x, int y, int w, int c) {
  cap[E] = w;
  flow[E] = 0;
  cost[E] = c;
  to[E] = y;
  prv[E] = last[x];
  last[x] = E;
  E++;
  cap[E] = 0;
  flow[E] = 0;
  cost[E] = -c;
  to[E] = x;
  prv[E] = last[y];
  last[y] = E;
  E++;
}
pair<int, int> MinCostFlow::search(int s, int t) {
  int ansf = 0;
  int ansc = 0;
  int i;
  for ((i) = 0; (i) < (int)(V); (i)++) used[i] = false;
  for ((i) = 0; (i) < (int)(V); (i)++) dist[i] = (1 << 29);
  dist[s] = 0;
  path[s] = -1;
  q.push(make_pair(0, s));
  while (!q.empty()) {
    int x = q.top().second;
    q.pop();
    if (used[x]) continue;
    used[x] = true;
    for (int e = last[x]; e >= 0; e = prv[e])
      if (cap[e] > 0) {
        int tmp = dist[x] + cost[e] + pot[x] - pot[to[e]];
        if (tmp < dist[to[e]] && !used[to[e]]) {
          dist[to[e]] = tmp;
          path[to[e]] = e;
          q.push(make_pair(-dist[to[e]], to[e]));
        }
      }
  }
  for ((i) = 0; (i) < (int)(V); (i)++) pot[i] += dist[i];
  if (used[t]) {
    ansf = (1 << 29);
    for (int e = path[t]; e >= 0; e = path[to[e ^ 1]]) ansf = min(ansf, cap[e]);
    for (int e = path[t]; e >= 0; e = path[to[e ^ 1]]) {
      ansc += cost[e] * ansf;
      cap[e] -= ansf;
      flow[e] += ansf;
      cap[e ^ 1] += ansf;
      flow[e ^ 1] -= ansf;
    }
  }
  return make_pair(ansf, ansc);
}
pair<int, int> MinCostFlow::mincostflow(int s, int t) {
  int ansf = 0;
  int ansc = 0;
  int i;
  for ((i) = 0; (i) < (int)(V); (i)++) pot[i] = 0;
  while (1) {
    pair<int, int> p = search(s, t);
    if (!used[t]) break;
    ansf += p.first;
    ansc += p.second;
  }
  return make_pair(ansf, ansc);
}
int a[MAXN], par[MAXN], var[MAXN];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  MinCostFlow mcf(2 * n + m + 2);
  for (int i = 0; i < n; i++)
    for (int j = n + i + 1; j < 2 * n; j++)
      mcf.add_edge(i, j, 1,
                   (a[i] == a[j - n] ? 0 : __builtin_popcount(a[j - n])));
  for (int i = 2 * n; i < 2 * n + m; i++)
    for (int j = n; j < 2 * n; j++)
      mcf.add_edge(i, j, 1, __builtin_popcount(a[j - n]));
  for (int i = 0; i < n; i++) mcf.add_edge(2 * n + m, i, 1, 0);
  for (int i = 0; i < m; i++) mcf.add_edge(2 * n + m, 2 * n + i, 1, 0);
  for (int i = n; i < 2 * n; i++) mcf.add_edge(i, 2 * n + m + 1, 1, 0);
  int min_cost = mcf.mincostflow(2 * n + m, 2 * n + m + 1).second;
  vector<pair<int, int> > edges = mcf.flow_edges();
  for (int i = 0; i < edges.size(); i++) {
    int u = edges[i].second;
    if (u >= n && u < 2 * n) par[u - n] = edges[i].first;
  }
  vector<string> ans;
  for (int i = 0; i < n; i++)
    if (par[i] >= n) {
      var[i] = par[i] - 2 * n;
      char cvar = 'a' + var[i];
      stringstream ss;
      ss << cvar << '=' << a[i];
      ans.push_back(ss.str());
      ans.push_back("print(" + string(1, cvar) + ")");
    } else {
      var[i] = var[par[i]];
      char cvar = 'a' + var[i];
      if (a[i] != a[par[i]]) {
        stringstream ss;
        ss << cvar << '=' << a[i];
        ans.push_back(ss.str());
      }
      ans.push_back("print(" + string(1, cvar) + ")");
    }
  printf("%lu %d\n", ans.size(), min_cost);
  for (int i = 0; i < ans.size(); i++) printf("%s\n", ans[i].c_str());
  return 0;
}