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;
int infinito = 1000000000;
int ini = 0;
int fin;
int capacidad[1000][1000];
int coste[1000][1000];
int flujo[1000][1000];
int potencial[1000];
int costetotal = 0;
int dist[1000];
int anterior[1000];
vector<int> g[1000];
int flujocalculado = 0;
void maxflowmincost() {
  for (int i = 0; i <= fin; i++) {
    for (int j = i + 1; j <= fin; j++) {
      if (capacidad[i][j] or capacidad[j][i]) {
        g[i].push_back(j);
        g[j].push_back(i);
      }
    }
  }
  for (;;) {
    for (int i = 0; i <= fin; i++) dist[i] = infinito;
    priority_queue<pair<int, int>, vector<pair<int, int> >,
                   greater<pair<int, int> > >
        q;
    q.push(pair<int, int>(0, ini));
    dist[ini] = 0;
    while (not q.empty()) {
      pair<int, int> p = q.top();
      q.pop();
      int du = p.first;
      int u = p.second;
      if (du == dist[u]) {
        vector<int> &ar = g[u];
        for (int i = 0; i < int(ar.size()); i++) {
          int v = ar[i];
          if (flujo[u][v] >= 0 and capacidad[u][v] > flujo[u][v] and
              du + coste[u][v] + potencial[u] - potencial[v] < dist[v]) {
            dist[v] = du + coste[u][v] + potencial[u] - potencial[v];
            anterior[v] = u;
            q.push(pair<int, int>(dist[v], v));
          } else if (flujo[u][v] < 0 and
                     du - coste[v][u] + potencial[u] - potencial[v] < dist[v]) {
            dist[v] = du - coste[v][u] + potencial[u] - potencial[v];
            anterior[v] = u;
            q.push(pair<int, int>(dist[v], v));
          }
        }
      }
    }
    if (dist[fin] == infinito) return;
    for (int i = 0; i <= fin; i++) potencial[i] += dist[i];
    int u = fin;
    int bot = infinito;
    while (u != ini) {
      int antu = anterior[u];
      if (flujo[antu][u] >= 0)
        bot = min(bot, capacidad[antu][u] - flujo[antu][u]);
      else
        bot = min(bot, -flujo[antu][u]);
      u = antu;
    }
    flujocalculado += bot;
    u = fin;
    while (u != ini) {
      int antu = anterior[u];
      if (flujo[antu][u] >= 0)
        costetotal += bot * coste[antu][u];
      else
        costetotal -= bot * coste[u][antu];
      flujo[antu][u] += bot;
      flujo[u][antu] -= bot;
      u = antu;
    }
  }
}
int numbits(int x) {
  int num = 0;
  while (x > 0) {
    num += x & 1;
    x /= 2;
  }
  return num;
}
string variable[1000];
int valor[1000];
string itos(int x) {
  string s;
  while (x > 0) {
    s = string(1, char(x % 10 + '0')) + s;
    x /= 10;
  }
  return s;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> valor[i];
  int tope = 2 * n + 1;
  capacidad[0][tope] = m;
  capacidad[tope][tope + 1] = m;
  capacidad[tope + 1][tope + 2] = m;
  for (int i = 1; i <= n; i++) {
    capacidad[0][2 * i] = 1;
    capacidad[tope][2 * i - 1] = 1;
    coste[tope][2 * i - 1] = numbits(valor[i]);
    capacidad[2 * i][tope + 1] = 1;
    capacidad[2 * i - 1][tope + 2] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      capacidad[2 * i][2 * j - 1] = 1;
      if (valor[i] != valor[j]) coste[2 * i][2 * j - 1] = numbits(valor[j]);
    }
  }
  fin = tope + 2;
  maxflowmincost();
  int varsusadas = 0;
  vector<string> sol;
  for (int i = 1; i <= n; i++) {
    if (flujo[tope][2 * i - 1]) {
      variable[i] = string(1, char('a' + varsusadas));
      varsusadas++;
      sol.push_back(variable[i] + "=" + itos(valor[i]));
      sol.push_back("print(" + variable[i] + ")");
    } else {
      for (int j = 1; j < i; j++) {
        if (flujo[2 * j][2 * i - 1]) {
          variable[i] = variable[j];
          if (valor[j] != valor[i])
            sol.push_back(variable[i] + "=" + itos(valor[i]));
          sol.push_back("print(" + variable[i] + ")");
          break;
        }
      }
    }
  }
  cout << int(sol.size()) << " " << costetotal << endl;
  for (int i = 0; i < int(sol.size()); i++) {
    cout << sol[i] << endl;
  }
}