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>
template <typename T>
inline void tension(T &a, const T &b) {
  if (a > b) a = b;
}
template <typename T>
inline bool tensionv(T &a, const T &b) {
  return a > b ? a = b, true : false;
}
inline unsigned int getuint() {
  char w = getchar();
  while (w < '0' || '9' < w) w = getchar();
  unsigned int ans = 0;
  for (; '0' <= w && w <= '9'; w = getchar()) ans = ans * 10 + w - '0';
  return ans;
}
int V, S, T;
const int MAXV = 233333, MAXE = 2333333;
struct Edge {
  int t, next, cap, v;
} G[MAXE];
int head[MAXV], e = 1;
inline void add_double_edge(int x, int y, int z, int v) {
  G[++e].t = y, G[e].next = head[x], head[x] = e;
  G[e].cap = z, G[e].v = v;
  G[++e].t = x, G[e].next = head[y], head[y] = e;
  G[e].cap = 0, G[e].v = -v;
}
inline void add_edge(int x, int y, int d, int u, int v) {
  if (d) add_double_edge(S, y, d, v), add_double_edge(x, T, d, 0);
  add_double_edge(x, y, u - d, v);
}
struct ZKW_Min_Cost_Flow {
  int dist[MAXV], inq[MAXV];
  std::pair<int, int> heap[MAXE];
  int heap_size;
  void SPFA() {
    memset(dist + 1, 0x3f, sizeof(*dist) * V),
        heap[heap_size++] = std::make_pair(-(dist[T] = 0), T),
        std::push_heap(heap, heap + heap_size);
    for (int d, x; heap_size;) {
      d = -heap->first, x = heap->second,
      std::pop_heap(heap, heap + heap_size--);
      if (d != dist[x]) continue;
      for (int i = head[x]; i; i = G[i].next)
        if (G[i ^ 1].cap && tensionv(dist[G[i].t], dist[x] - G[i].v))
          heap[heap_size++] = std::make_pair(-dist[G[i].t], G[i].t),
          std::push_heap(heap, heap + heap_size);
    }
  }
  int dfs(int x, int aug0) {
    if (x == T) return aug0;
    inq[x] = 1;
    int aug = aug0;
    for (int i = head[x]; i; i = G[i].next)
      if (!inq[G[i].t] && G[i].cap && dist[x] == dist[G[i].t] + G[i].v) {
        int flow = dfs(G[i].t, std::min(aug, G[i].cap));
        if (flow) {
          G[i].cap -= flow, G[i ^ 1].cap += flow, aug -= flow;
          if (!aug) break;
        }
      }
    return aug0 - aug;
  }
  bool modify_label() {
    int t = 0x3f3f3f3f;
    for (int x = 1; x <= V; x++)
      if (inq[x])
        for (int i = head[x]; i; i = G[i].next)
          if (!inq[G[i].t] && G[i].cap)
            tension(t, dist[G[i].t] + G[i].v - dist[x]);
    if (t == 0x3f3f3f3f) return false;
    for (int i = 1; i <= V; i++)
      if (inq[i]) dist[i] += t;
    return true;
  }
  int min_cost_flow() {
    SPFA();
    int ans = 0;
    for (;;) {
      for (int t;;) {
        memset(inq + 1, 0, sizeof(*inq) * V);
        if (t = dfs(S, 0x3f3f3f3f))
          ans += dist[S] * t;
        else
          break;
      }
      if (!modify_label()) break;
    }
    return ans;
  }
} ZKW_MCF;
int main() {
  S = ++V, T = ++V;
  int S0 = ++V, S1 = ++V, T0 = ++V;
  add_edge(T0, S0, 0, 0x3f3f3f3f, 0);
  static int id[2333][2], a[2333], c[2333], ide[MAXE], last[2333];
  int n = getuint(), m = getuint();
  for (int i = 1; i <= n; i++)
    for (int j = a[i] = getuint(); j; j >>= 1)
      if (j & 1) c[i]++;
  for (int i = 1; i <= n; i++)
    id[i][0] = ++V, id[i][1] = ++V, add_edge(id[i][0], id[i][1], 1, 1, 0);
  add_edge(S0, S1, 0, m, 0);
  for (int i = 1; i <= n; i++)
    add_edge(S1, id[i][0], 0, 1, c[i]), add_edge(id[i][1], T0, 0, 1, 0);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      add_edge(id[i][1], id[j][0], 0, 1, a[i] != a[j] ? c[j] : 0), ide[e] = i;
  int cnt = n, ans = ZKW_MCF.min_cost_flow();
  for (int x, l = 1; l <= n; l++)
    for (int i = head[x = id[l][0]]; i; i = G[i].next)
      if (G[i].cap) last[l] = ide[i];
  for (int i = 1; i <= n; i++) cnt += (!last[i] || a[last[i]] != a[i]);
  printf("%d %d\n", cnt, ans);
  static char ch[2333], now = 'a';
  for (int i = 1; i <= n; printf("print(%c)\n", ch[i++]))
    if (last[i]) {
      ch[i] = ch[last[i]];
      if (a[last[i]] != a[i]) printf("%c=%d\n", ch[i], a[i]);
    } else
      printf("%c=%d\n", ch[i] = now++, a[i]);
  return 0;
}