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 countbit(int v) {
  int c;
  for (c = 0; v; v >>= 1) {
    c += v & 1;
  }
  return c;
}
namespace MinCostFlow {
const int inf = INT_MAX >> 2;
const int NN = 256;
struct Edge {
  int v, rev, cap, cost;
  Edge() : v(0), rev(0), cap(0), cost(0) {}
  Edge(int v, int rev, int cap, int cost)
      : v(v), rev(rev), cap(cap), cost(cost) {}
};
vector<Edge> edges[NN];
int size, dist[NN], pot[NN];
int prev[NN], prev_eid[NN];
char used[NN];
void Init(int _s) {
  size = _s;
  for (int i = 0; i < size; ++i) {
    edges[i].clear();
    dist[i] = 0;
    prev_eid[i] = 0;
    pot[i] = 0;
    prev_eid[i] = 0;
  }
}
void add_edge(int a, int b, int cap, int cost) {
  if (a == b) return;
  edges[a].push_back(Edge(b, edges[b].size() + (a == b), cap, cost));
  edges[b].push_back(Edge(a, edges[a].size() - 1, 0, -cost));
}
pair<int, int> mcmf(int s, int t, int needToFlow = inf) {
  pair<int, int> res;
  memset(pot, 0, sizeof(pot));
  while (needToFlow > 0) {
    memset(used, 0, sizeof(used));
    memset(prev, -1, sizeof(prev));
    for (int i = 0; i < size; ++i) dist[i] = inf;
    dist[s] = 0;
    char update = 1;
    while (update) {
      update = 0;
      for (int v = 0; v < size; ++v) {
        if (dist[v] == inf) continue;
        for (int i = 0; i < edges[v].size(); ++i) {
          Edge& e = edges[v][i];
          if (e.cap > 0 && dist[e.v] > dist[v] + e.cost) {
            dist[e.v] = dist[v] + e.cost;
            prev[e.v] = v;
            prev_eid[e.v] = i;
            update = 1;
          }
        }
      }
    }
    if (dist[t] == inf) break;
    for (int i = 0; i < size; ++i) dist[i] += pot[i], pot[i] = dist[i];
    int bottleNeck = inf;
    for (int v = t; v != s && v != -1; v = prev[v]) {
      bottleNeck = min(bottleNeck, edges[prev[v]][prev_eid[v]].cap);
    }
    res.first += bottleNeck;
    needToFlow -= bottleNeck;
    for (int v = t; v != s; v = prev[v]) {
      Edge& e = edges[prev[v]][prev_eid[v]];
      res.second += e.cost * bottleNeck;
      e.cap -= bottleNeck;
      edges[v][e.rev].cap += bottleNeck;
    }
  }
  return res;
}
}  // namespace MinCostFlow
int input[256];
int distinctInput[256];
int consectiveCnt[256];
int cost[256];
char buf[1024];
int main() {
  int m, n;
  int totalCost;
  while (~scanf("%d%d", &n, &m)) {
    totalCost = 0;
    int disN = 0;
    memset(distinctInput, 0, sizeof(distinctInput));
    memset(consectiveCnt, 0, sizeof(consectiveCnt));
    for (int i = 0; i < n; ++i) {
      scanf("%d", input + i);
      if (i == 0 || input[i] != input[i - 1]) {
        distinctInput[disN] = input[i];
        cost[disN] = countbit(input[i]);
        totalCost += cost[disN];
        ++disN;
      } else
        ++consectiveCnt[disN - 1];
    }
    MinCostFlow::Init(disN);
    map<int, int> prevNodeSameId;
    for (int i = 0; i < disN; ++i) {
      if (i) MinCostFlow::add_edge(i - 1, i, MinCostFlow::inf, 0);
      if (prevNodeSameId.find(distinctInput[i]) != prevNodeSameId.end()) {
        if (prevNodeSameId[distinctInput[i]] != i - 1) {
          MinCostFlow::add_edge(prevNodeSameId[distinctInput[i]] + 1, i, 1,
                                -cost[i]);
        }
      }
      prevNodeSameId[distinctInput[i]] = i;
    }
    pair<int, int> ans = MinCostFlow::mcmf(0, disN - 1, m - 1);
    ans.second = totalCost + ans.second;
    vector<string> output;
    int var[26] = {0};
    for (int i = 0; i < disN; ++i) {
      int storeVar = find(var, var + m, distinctInput[i]) - var;
      if (storeVar == m) {
        for (storeVar = 0; var[storeVar]; ++storeVar)
          ;
        var[storeVar] = distinctInput[i];
        sprintf(buf, "%c=%d", storeVar + 'a', distinctInput[i]);
        output.push_back(buf);
      }
      sprintf(buf, "print(%c)", storeVar + 'a');
      for (int j = 0; j < consectiveCnt[i] + 1; ++j) output.push_back(buf);
      if (i + 1 < disN) {
        for (int j = 0; j < MinCostFlow::edges[i + 1].size(); ++j) {
          if (MinCostFlow::edges[i + 1][j].cost == -cost[i] &&
              MinCostFlow::edges[i + 1][j].cap == 0)
            goto nextVarPrint;
        }
      }
      var[storeVar] = 0;
    nextVarPrint:;
    }
    printf("%d %d\n", output.size(), ans.second);
    for (int i = 0; i < output.size(); ++i) puts(output[i].c_str());
  }
  return 0;
}