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 = 1000;
const int INF = 1e9;
inline int in(int x) { return 2 * x; }
inline int out(int x) { return 2 * x + 1; }
int cap[MAXn][MAXn], cost[MAXn][MAXn];
int vn;
int dist[MAXn];
int rcap[MAXn][MAXn], rcost[MAXn][MAXn];
void bellman(int s) {
  for (int i = 0; i < vn; i++) dist[i] = INF;
  dist[s] = 0;
  for (int i = 0; i < vn - 1; i++)
    for (int j = 0; j < vn; j++)
      for (int k = 0; k < vn; k++)
        if (dist[j] != INF && rcap[j][k] != 0 &&
            dist[j] + rcost[j][k] < dist[k])
          dist[k] = dist[j] + rcost[j][k];
}
bool mark[MAXn];
void dijkstra(int s) {
  for (int i = 0; i < vn; i++) mark[i] = false, dist[i] = INF;
  dist[s] = 0;
  while (true) {
    int v = -1;
    for (int i = 0; i < vn; i++)
      if (mark[i] != true && (v == -1 || dist[i] < dist[v])) v = i;
    if (v == -1) break;
    mark[v] = true;
    for (int i = 0; i < vn; i++)
      if (rcap[v][i] != 0) dist[i] = min(dist[i], dist[v] + rcost[v][i]);
  }
}
int par[MAXn];
void fillPar(int s, int t) {
  for (int i = 0; i < vn; i++) par[i] = -1, mark[i] = false;
  queue<int> q;
  q.push(s);
  mark[s] = true;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < vn; i++)
      if (rcost[v][i] == 0 && rcap[v][i] != 0 && !mark[i]) {
        mark[i] = true;
        par[i] = v;
        q.push(i);
        if (i == t) return;
      }
  }
}
int maxFlow(int s, int t) {
  int flow = 0;
  while (true) {
    fillPar(s, t);
    if (par[t] == -1) break;
    int mn = INF;
    int v = t;
    while (par[v] != -1) mn = min(mn, rcap[par[v]][v]), v = par[v];
    v = t;
    flow += mn;
    while (par[v] != -1)
      rcap[par[v]][v] -= mn, rcap[v][par[v]] += mn, v = par[v];
  }
  return flow;
}
void reduce_cost() {
  for (int i = 0; i < vn; i++)
    for (int j = 0; j < vn; j++)
      if (rcap[i][j] != 0 && dist[j] != INF && dist[i] != INF)
        rcost[i][j] += dist[i] - dist[j];
}
void minCostFlow(int s, int t) {
  for (int i = 0; i < vn; i++)
    for (int j = 0; j < vn; j++)
      rcap[i][j] = cap[i][j], rcost[i][j] = cost[i][j];
  bellman(s);
  reduce_cost();
  while (true) {
    dijkstra(s);
    reduce_cost();
    int ret = maxFlow(s, t);
    if (ret == 0) return;
  }
}
int n, m;
vector<int> bitc, num;
int cc;
int var[MAXn];
void dfs(int v) {
  var[v] = cc;
  mark[v] = true;
  for (int j = v + 1; j < vn; j++)
    if (!mark[j] && cap[v][j] != rcap[v][j]) dfs(j);
}
int vvar[MAXn];
int main() {
  cin >> n >> m;
  bitc.push_back(0);
  num.push_back(0);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    num.push_back(x);
    int c = 0;
    while (x > 0) {
      c += x % 2;
      x /= 2;
    }
    bitc.push_back(c);
  }
  n++;
  for (int i = 0; i < n; i++)
    cap[in(i)][out(i)] = 1, cost[in(i)][out(i)] = -100000;
  for (int i = 0; i < (int)bitc.size(); i++)
    for (int j = i + 1; j < (int)bitc.size(); j++)
      cap[out(i)][in(j)] = 1,
      cost[out(i)][in(j)] = ((num[i] == num[j]) ? 0 : bitc[j]);
  cap[0][1] = m, cost[0][1] = 0;
  for (int i = 0; i < n; i++) cap[out(i)][2 * n] = INF, cost[out(i)][2 * n] = 0;
  vn = 2 * n + 1;
  minCostFlow(0, vn - 1);
  int c = 0;
  for (int i = 0; i < vn; i++)
    for (int j = i + 1; j < vn; j++) c += (cap[i][j] - rcap[i][j]) * cost[i][j];
  for (int i = 0; i < vn; i++) mark[i] = false;
  cc = 0;
  for (int i = 1; i < n; i++)
    if (cap[1][in(i)] != rcap[1][in(i)]) {
      cc++;
      dfs(in(i));
    }
  int count = 0;
  for (int i = 1; i < n; i++) {
    int vi = var[in(i)] - 1;
    if (num[i] != vvar[vi]) count++;
    vvar[vi] = num[i];
    count++;
  }
  for (int i = 0; i < MAXn; i++) vvar[i] = 0;
  cout << count << " " << c - (n - 1) * -100000 << endl;
  for (int i = 1; i < n; i++) {
    int vi = var[in(i)] - 1;
    char vc = 'a' + vi;
    if (num[i] != vvar[vi]) cout << vc << "=" << num[i] << endl;
    vvar[vi] = num[i];
    cout << "print(" << vc << ")" << endl;
  }
  return 0;
}