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;
struct edge_t {
  int from, to;
  long long cost, capacity, flow, ncflow;
};
class Network {
 private:
  int nnodes, source_node, target_node;
  vector<long long> potential;
  long long path_capacity;
  vector<int> visited;
  vector<edge_t *> parent_edge;
  vector<long long> lcost;
  vector<int> reachable;
  bool bellman_ford() {
    for (int i = 0; i < nnodes; i++) lcost[i] = LLONG_MAX;
    lcost[source_node] = 0;
    reachable.resize(nnodes);
    fill(reachable.begin(), reachable.end(), false);
    reachable[source_node] = true;
    for (int i = 0; i + 1 < nnodes; i++) {
      for (int u = 0; u < nnodes; u++) {
        int ne = edges[u].size();
        for (int k = 0; k < ne; k++) {
          edge_t *p = edges[u][k];
          if (u == edges[u][k]->from) {
            if (p->capacity - p->ncflow > 0) {
              int v = p->to;
              if (p->cost < 0 or lcost[u] < lcost[v] - p->cost) {
                lcost[v] = lcost[u] + p->cost;
                parent_edge[v] = p;
              }
              if (reachable[u]) {
                reachable[v] = true;
              }
            }
          }
        }
      }
    }
    for (int u = 0; u < nnodes; u++) {
      int ne = edges[u].size();
      int v;
      edge_t *p;
      for (int k = 0; k < ne; k++) {
        p = edges[u][k];
        if (p->ncflow < p->capacity) {
          if (u == p->from) {
            v = p->to;
            if (lcost[u] < lcost[v] - p->cost) {
              long long cycle_capa = p->capacity - p->ncflow;
              int w = u;
              edge_t *q;
              while (w != v) {
                q = parent_edge[w];
                if (q->capacity - q->ncflow < cycle_capa) {
                  cycle_capa = q->capacity - q->ncflow;
                }
                w = q->from;
              }
              w = u;
              p->ncflow += cycle_capa;
              while (w != v) {
                q = parent_edge[w];
                q->ncflow += cycle_capa;
                w = q->from;
              }
              return false;
            }
          }
        }
      }
    }
    return true;
  }
  void dijkstra() {
    for (int i = 0; i < nnodes; i++) lcost[i] = LLONG_MAX, visited[i] = 0;
    lcost[source_node] = 0;
    fill(reachable.begin(), reachable.end(), false);
    reachable[source_node] = true;
    for (int i = 0; i < nnodes; i++) {
      long long lc = LLONG_MAX;
      int u = 0;
      for (int j = 0; j < nnodes; j++)
        if (not visited[j] and lcost[j] < lc) {
          u = j;
          lc = lcost[u];
        }
      int ne = edges[u].size();
      for (int k = 0; k < ne; k++) {
        edge_t *p = edges[u][k];
        int v = -1, dir = 0;
        bool feasible = false;
        if (u == p->from) {
          v = p->to;
          feasible = p->flow + p->ncflow < p->capacity;
          dir = 1;
        }
        if (u == p->to) {
          v = p->from;
          feasible = 0 < p->flow;
          dir = -1;
        }
        if (feasible) {
          if (reachable[u] and lcost[u] + dir * (p->cost + potential[p->to] -
                                                 potential[p->from]) <
                                   lcost[v]) {
            lcost[v] = lcost[u] +
                       dir * (p->cost + potential[p->to] - potential[p->from]);
            parent_edge[v] = p;
            reachable[v] = true;
          }
        }
      }
      visited[u] = true;
    }
  }
  void augment_flow() {
    int u = target_node, v = -1;
    long long path_capacity = LLONG_MAX;
    while (u != source_node) {
      edge_t *p = parent_edge[u];
      long long capa;
      if (u == p->to) {
        v = p->from;
        capa = p->capacity - p->flow - p->ncflow;
      }
      if (u == p->from) {
        v = p->to;
        capa = p->flow;
      }
      path_capacity = min(path_capacity, capa);
      u = v;
    }
    v = target_node;
    int dir = 0;
    while (v != source_node) {
      edge_t *p = parent_edge[v];
      if (v == p->to) {
        u = p->from;
        dir = 1;
      }
      if (v == p->from) {
        u = p->to;
        dir = -1;
      }
      p->flow += dir * path_capacity;
      v = u;
    }
  }
  void update_potentials() {
    for (int u = 0; u < nnodes; u++) {
      if (reachable[u]) {
        potential[u] -= lcost[u];
      }
    }
  }

 public:
  vector<vector<edge_t *> > edges;
  Network(int n, int s = -1, int t = -1) {
    nnodes = n;
    if (s == -1) {
      source_node = n - 2;
    } else {
      source_node = s;
    }
    if (t == -1) {
      target_node = n - 1;
    } else {
      target_node = t;
    }
    edges.resize(n);
    lcost.resize(n);
    parent_edge.resize(n);
    visited.resize(n);
    potential.resize(n);
    for (int i = 0; i < n; i++) potential[i] = 0;
  }
  void addedge(int u, int v, long long capacity, long long cost = 1) {
    edge_t *p = new edge_t;
    p->from = u;
    p->to = v;
    p->capacity = capacity;
    p->cost = cost;
    p->flow = 0;
    p->ncflow = 0;
    edges[u].push_back(p);
    edges[v].push_back(p);
  }
  vector<long long> mcmf() {
    vector<long long> res(2, 0);
    while (not bellman_ford())
      ;
    update_potentials();
    while (true) {
      dijkstra();
      if (not reachable[target_node]) break;
      update_potentials();
      augment_flow();
    }
    long long c = 0, f = 0;
    for (int i = 0; i < nnodes; i++) {
      int ne = edges[i].size();
      edge_t *p;
      for (int k = 0; k < ne; k++) {
        p = edges[i][k];
        if (i == p->from) {
          c += p->cost * (p->flow + p->ncflow);
        }
      }
    }
    int ne = edges[source_node].size();
    for (int k = 0; k < ne; k++) {
      f += edges[source_node][k]->flow;
    }
    res[0] = c;
    res[1] = f;
    return res;
  }
  void print() {
    cerr << "from"
         << "\t";
    cerr << "to"
         << "\t";
    cerr << "capa"
         << "\t";
    cerr << "cost"
         << "\t";
    cerr << "flow" << endl;
    for (int i = 0; i < nnodes; i++) {
      int ne = edges[i].size();
      edge_t *p;
      for (int k = 0; k < ne; k++) {
        p = edges[i][k];
        if (i == p->from) {
          cerr << p->from << "\t";
          cerr << p->to << "\t";
          cerr << p->capacity << "\t";
          cerr << p->cost << "\t";
          cerr << p->flow << endl;
        }
      }
    }
  }
  ~Network() {
    vector<edge_t *> to_delete;
    for (int i = 0; i < nnodes; i++) {
      int ne = edges[i].size();
      edge_t *p;
      for (int k = 0; k < ne; k++) {
        p = edges[i][k];
        if (i == p->from) {
          to_delete.push_back(p);
        }
      }
    }
    for (int i = 0; i < to_delete.size(); i++) {
      delete to_delete[i];
    }
  }
};
string i2s(int i) {
  stringstream ss;
  ss << i;
  return ss.str();
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int nleft = n + m, nright = n;
  int N = nleft + nright + 2;
  Network G(N, N - 2, N - 1);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      G.addedge(i, nleft + j, 1, a[i] == a[j] ? 0 : __builtin_popcount(a[j]));
    }
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) {
      G.addedge(n + i, nleft + j, 1, __builtin_popcount(a[j]));
    }
  for (int i = 0; i < nleft; i++) {
    G.addedge(N - 2, i, 1, 0);
  }
  for (int i = 0; i < nright; i++) {
    G.addedge(nleft + i, N - 1, 1, 0);
  }
  G.mcmf();
  vector<string> r;
  int total_cost = 0;
  vector<int> which(n, 0);
  for (int i = 0; i < n; i++) {
    int ne = G.edges[nleft + i].size();
    for (int k = 0; k < ne; k++) {
      edge_t *p = G.edges[nleft + i][k];
      if (nleft + i == p->to) {
        int j = p->from;
        if (p->flow != 0) {
          if (j < n) {
            char var = 'a' + which[j];
            stringstream ss;
            string svar;
            ss << var;
            ss >> svar;
            if (a[i] != a[j]) {
              r.push_back(svar + "=" + i2s(a[i]));
              total_cost += p->cost;
            }
            which[i] = which[j];
            r.push_back("print(" + svar + ")");
          } else {
            j -= n;
            char var = 'a' + j;
            stringstream ss;
            string svar;
            ss << var;
            ss >> svar;
            which[i] = j;
            r.push_back(svar + "=" + i2s(a[i]));
            r.push_back("print(" + svar + ")");
            total_cost += p->cost;
          }
        }
      }
    }
  }
  cout << r.size() << " " << total_cost << endl;
  for (int i = 0; i < r.size(); i++) {
    cout << r[i] << endl;
  }
}