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 INF = 1000111000;
template <class Flow = int, class Cost = int>
struct MinCostFlow {
  int n, t, S, T;
  Flow totalFlow;
  Cost totalCost;
  vector<int> last, visited;
  vector<Cost> dis;
  struct Edge {
    int to;
    Flow cap;
    Cost cost;
    int next;
    Edge(int to, Flow cap, Cost cost, int next)
        : to(to), cap(cap), cost(cost), next(next) {}
  };
  vector<Edge> edges;
  MinCostFlow(int n)
      : n(n),
        t(0),
        totalFlow(0),
        totalCost(0),
        last(n, -1),
        visited(n, 0),
        dis(n, 0) {
    edges.clear();
  }
  int addEdge(int from, int to, Flow cap, Cost cost) {
    edges.push_back(Edge(to, cap, cost, last[from]));
    last[from] = t++;
    edges.push_back(Edge(from, 0, -cost, last[to]));
    last[to] = t++;
    return t - 2;
  }
  pair<Flow, Cost> minCostFlow(int _S, int _T) {
    S = _S;
    T = _T;
    SPFA();
    while (1) {
      while (1) {
        for (int i = 0, _a = (n); i < _a; i++) visited[i] = 0;
        if (!findFlow(S, INF)) break;
      }
      if (!modifyLabel()) break;
    }
    return make_pair(totalFlow, totalCost);
  }

 private:
  void SPFA() {
    for (int i = 0, _a = (n); i < _a; i++) dis[i] = INF;
    priority_queue<pair<Cost, int> > Q;
    Q.push(make_pair(dis[S] = 0, S));
    while (!Q.empty()) {
      int x = Q.top().second;
      Cost d = -Q.top().first;
      Q.pop();
      if (dis[x] != d) continue;
      for (int it = last[x]; it >= 0; it = edges[it].next)
        if (edges[it].cap > 0 && dis[edges[it].to] > d + edges[it].cost)
          Q.push(make_pair(-(dis[edges[it].to] = d + edges[it].cost),
                           edges[it].to));
    }
    for (int i = 0, _a = (n); i < _a; i++) dis[i] = dis[T] - dis[i];
  }
  Flow findFlow(int x, Flow flow) {
    if (x == T) {
      totalCost += dis[S] * flow;
      totalFlow += flow;
      return flow;
    }
    visited[x] = 1;
    Flow now = flow;
    for (int it = last[x]; it >= 0; it = edges[it].next)
      if (edges[it].cap && !visited[edges[it].to] &&
          dis[edges[it].to] + edges[it].cost == dis[x]) {
        Flow tmp = findFlow(edges[it].to, min(now, edges[it].cap));
        edges[it].cap -= tmp;
        edges[it ^ 1].cap += tmp;
        now -= tmp;
        if (!now) break;
      }
    return flow - now;
  }
  bool modifyLabel() {
    Cost d = INF;
    for (int i = 0, _a = (n); i < _a; i++)
      if (visited[i])
        for (int it = last[i]; it >= 0; it = edges[it].next)
          if (edges[it].cap && !visited[edges[it].to])
            d = min(d, dis[edges[it].to] + edges[it].cost - dis[i]);
    if (d == INF) return false;
    for (int i = 0, _a = (n); i < _a; i++)
      if (visited[i]) dis[i] += d;
    return true;
  }
};
const int MN = 311;
int n, m, a[MN];
char var[MN];
int edgeId[MN][MN];
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(NULL);
  while (cin >> n >> m) {
    for (int i = (1), _b = (n); i <= _b; i++) cin >> a[i];
    MinCostFlow<int, int> flow(2 * (m + n) + 2);
    int sink = 2 * (m + n) + 1;
    for (int i = (1), _b = (m + n); i <= _b; i++) flow.addEdge(0, i, 1, 0);
    for (int i = (m + n + 1), _b = (sink - 1); i <= _b; i++)
      flow.addEdge(i, sink, 1, 0);
    memset(edgeId, -1, sizeof edgeId);
    for (int i = (1), _b = (m + n); i <= _b; i++)
      if (i <= m) {
        for (int j = (m + 1), _b = (m + n); j <= _b; j++)
          edgeId[i][j] =
              flow.addEdge(i, j + (m + n), 1, __builtin_popcount(a[j - m]));
      } else {
        for (int j = (i + 1), _b = (m + n); j <= _b; j++) {
          int cost = (a[i - m] == a[j - m]) ? 0 : __builtin_popcount(a[j - m]);
          edgeId[i][j] = flow.addEdge(i, j + (m + n), 1, cost);
        }
      }
    pair<int, int> res = flow.minCostFlow(0, sink);
    vector<pair<int, pair<int, int> > > statements;
    for (int j = (m + 1), _b = (m + n); j <= _b; j++) {
      int v = m + n + j;
      for (int i = (1), _b = (m + n); i <= _b; i++)
        if (edgeId[i][j] >= 0 && !flow.edges[edgeId[i][j]].cap) {
          if (i <= m) {
            statements.push_back(make_pair(0, make_pair(i, a[j - m])));
            statements.push_back(make_pair(1, make_pair(i, 0)));
            var[j - m] = i;
          } else {
            var[j - m] = var[i - m];
            if (a[i - m] == a[j - m]) {
              statements.push_back(make_pair(1, make_pair(var[j - m], 0)));
            } else {
              statements.push_back(
                  make_pair(0, make_pair(var[j - m], a[j - m])));
              statements.push_back(make_pair(1, make_pair(var[j - m], 0)));
            }
          }
        }
    }
    cout << statements.size() << ' ' << res.second << "\n";
    for (int i = 0, _a = (statements.size()); i < _a; i++) {
      if (statements[i].first == 0) {
        cout << (char)(statements[i].second.first - 1 + 'a') << '='
             << statements[i].second.second << "\n";
      } else {
        cout << "print(" << (char)(statements[i].second.first - 1 + 'a')
             << ")\n";
      }
    }
  }
}