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;
class SuccessiveShortestPath {
 public:
  class MinCostMaxFlowEdge {
   public:
    MinCostMaxFlowEdge(int destination, long long capacity, long long cost) {
      this->destination_ = destination;
      this->capacity_ = capacity;
      this->cost_ = cost;
      this->flow_ = 0L;
    }
    MinCostMaxFlowEdge(MinCostMaxFlowEdge& ref) {
      this->destination_ = ref.destination_;
      this->capacity_ = ref.capacity_;
      this->cost_ = ref.cost_;
      this->flow_ = ref.flow_;
    }
    int destination_;
    long long capacity_;
    long long cost_;
    long long flow_;
  };
  vector<vector<MinCostMaxFlowEdge*> > adj_;
  vector<long long> supply_;
  SuccessiveShortestPath(int node_count) {
    supply_ = vector<long long>(node_count, 0LL);
    adj_ = vector<vector<MinCostMaxFlowEdge*> >(node_count,
                                                vector<MinCostMaxFlowEdge*>());
  }
  void addEdge(int from, int to, long long capacity, long long cost) {
    adj_[from].push_back(new MinCostMaxFlowEdge(to, capacity, cost));
  }
  void setSupply(int node, long long amount) { supply_[node] = amount; }
  long long solve(int* is_infeasible) {
    *is_infeasible = 0;
    int n = ((int)supply_.size());
    vector<vector<MinCostMaxFlowEdge*> > adjcopy = adj_;
    for (int i = 0; i < ((int)adj_.size()); ++i) {
      for (int j = 0; j < ((int)adj_[i].size()); ++j) {
        adjcopy[i][j] = new MinCostMaxFlowEdge(*(adj_[i][j]));
      }
    }
    vector<vector<MinCostMaxFlowEdge*> > reverse_adj(
        n, vector<MinCostMaxFlowEdge*>());
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < ((int)adjcopy[i].size()); ++j) {
        reverse_adj[i].push_back(NULL);
      }
    }
    vector<long long> supply_cpy = supply_;
    for (int i = 0; i < n; ++i) {
      int sigma = ((int)adjcopy[i].size());
      for (int j = 0; j < sigma; ++j) {
        if (reverse_adj[i][j] == NULL) {
          int destination = adjcopy[i][j]->destination_;
          long long cost = adjcopy[i][j]->cost_;
          MinCostMaxFlowEdge* new_edge = new MinCostMaxFlowEdge(i, 0, -cost);
          adjcopy[destination].push_back(new_edge);
          reverse_adj[destination].push_back(adjcopy[i][j]);
          reverse_adj[i][j] = new_edge;
          if (cost < 0LL) {
            adjcopy[i][j]->flow_ = adjcopy[i][j]->capacity_;
            reverse_adj[i][j]->flow_ = -adjcopy[i][j]->capacity_;
            supply_cpy[i] -= adjcopy[i][j]->capacity_;
            supply_cpy[adjcopy[i][j]->destination_] += adjcopy[i][j]->capacity_;
          }
        }
      }
    }
    int tap = n;
    int sink = n + 1;
    adjcopy.push_back(vector<MinCostMaxFlowEdge*>());
    adjcopy.push_back(vector<MinCostMaxFlowEdge*>());
    reverse_adj.push_back(vector<MinCostMaxFlowEdge*>());
    reverse_adj.push_back(vector<MinCostMaxFlowEdge*>());
    long long flow_snd = 0LL;
    long long flow_rcv = 0LL;
    for (int i = 0; i < n; ++i) {
      if (supply_cpy[i] > 0LL) {
        flow_snd += supply_cpy[i];
        MinCostMaxFlowEdge* fwd = new MinCostMaxFlowEdge(i, supply_cpy[i], 0LL);
        MinCostMaxFlowEdge* bck = new MinCostMaxFlowEdge(tap, 0, 0LL);
        adjcopy[tap].push_back(fwd);
        reverse_adj[tap].push_back(bck);
        adjcopy[i].push_back(bck);
        reverse_adj[i].push_back(fwd);
      } else if (supply_cpy[i] < 0LL) {
        flow_rcv += -supply_cpy[i];
        MinCostMaxFlowEdge* fwd =
            new MinCostMaxFlowEdge(sink, -supply_cpy[i], 0LL);
        MinCostMaxFlowEdge* bck = new MinCostMaxFlowEdge(i, 0, 0LL);
        adjcopy[i].push_back(fwd);
        reverse_adj[i].push_back(bck);
        adjcopy[sink].push_back(bck);
        reverse_adj[sink].push_back(fwd);
      }
    }
    if (flow_snd != flow_rcv) {
      *is_infeasible = 1;
      return -13LL;
    }
    vector<long long> pi(n + 2, 0LL);
    vector<int> pred(n + 2, 0), pred_adj(n + 2, 0);
    vector<long long> shortest(n + 2, 0LL);
    set<pair<long long, int> > pq;
    long long total_flow = 0LL;
    while (true) {
      pq.insert(make_pair(0LL, tap));
      for (int i = 0; i < n + 2; ++i) {
        shortest[i] = -1LL;
      }
      shortest[tap] = 0LL;
      while (!pq.empty()) {
        long long dist = pq.begin()->first;
        int node = pq.begin()->second;
        pq.erase(pq.begin());
        if (shortest[node] != dist) continue;
        for (int i = 0; i < ((int)adjcopy[node].size()); ++i) {
          MinCostMaxFlowEdge* ed = adjcopy[node][i];
          if (ed->capacity_ - ed->flow_ <= 0LL) {
            continue;
          }
          int dest = ed->destination_;
          long long new_dist = dist + ed->cost_ - pi[node] + pi[dest];
          assert(new_dist >= dist);
          if (shortest[dest] == -1LL || shortest[dest] > new_dist) {
            shortest[dest] = new_dist;
            pq.insert(make_pair(new_dist, dest));
            pred[dest] = node;
            pred_adj[dest] = i;
          }
        }
      }
      if (shortest[sink] == -1LL) {
        break;
      }
      for (int j = 0; j < n + 2; ++j) {
        if (shortest[j] != -1LL) {
          pi[j] = pi[j] - shortest[j];
        }
      }
      vector<int> nodes;
      vector<int> go_next;
      nodes.push_back(sink);
      go_next.push_back(-1);
      while (nodes.back() != tap) {
        go_next.push_back(pred_adj[nodes.back()]);
        nodes.push_back(pred[nodes.back()]);
      }
      reverse(nodes.begin(), nodes.end());
      reverse(go_next.begin(), go_next.end());
      long long flow = flow_snd;
      for (int(i) = 0; (i) < (((int)nodes.size()) - 1); ++(i))
        flow = min((flow), (adjcopy[nodes[i]][go_next[i]]->capacity_ -
                            adjcopy[nodes[i]][go_next[i]]->flow_));
      total_flow += flow;
      for (int(i) = 0; (i) < (((int)nodes.size()) - 1); ++(i)) {
        adjcopy[nodes[i]][go_next[i]]->flow_ += flow;
        reverse_adj[nodes[i]][go_next[i]]->flow_ -= flow;
      }
    }
    if (total_flow != flow_snd) {
      *is_infeasible = 1;
      return 0LL;
    }
    long long answer = 0LL;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < ((int)adj_[i].size()); ++j) {
        adj_[i][j]->flow_ = adjcopy[i][j]->flow_;
        answer += adj_[i][j]->flow_ * adj_[i][j]->cost_;
      }
    }
    return answer;
  }
};
int bitcnt(int num) {
  int ret = 0;
  while (num) {
    ret += num % 2;
    num /= 2;
  }
  return ret;
}
int main() {
  int n, m;
  cin >> n >> m;
  SuccessiveShortestPath mcmf(n * 2 + 4);
  int tap = 2 * n;
  int ptap = 2 * n + 1;
  int sink = 2 * n + 2;
  int psink = 2 * n + 3;
  mcmf.setSupply(tap, m);
  mcmf.setSupply(sink, -m);
  mcmf.addEdge(tap, ptap, m, 0);
  mcmf.addEdge(psink, sink, m, 0);
  mcmf.addEdge(ptap, psink, m, 0);
  vector<int> vals;
  for (int(i) = 0; (i) < (n); ++(i)) {
    int a;
    cin >> a;
    vals.push_back(a);
  }
  for (int(i) = 0; (i) < (n); ++(i)) {
    mcmf.addEdge(ptap, i, 1, bitcnt(vals[i]));
    mcmf.addEdge(n + i, psink, 1, 0);
    mcmf.addEdge(i, n + i, 1, -100000);
    for (int(j) = (i + 1); (j) < (n); ++(j)) {
      if (vals[i] == vals[j]) {
        mcmf.addEdge(n + i, j, 1, 0);
      } else {
        mcmf.addEdge(n + i, j, 1, bitcnt(vals[j]));
      }
    }
  }
  int infeasible;
  long long ans = mcmf.solve(&infeasible);
  vector<pair<int, int> > changes[555];
  int id = 0;
  for (int(i) = 0; (i) < (((int)mcmf.adj_[ptap].size())); ++(i)) {
    int j = mcmf.adj_[ptap][i]->destination_;
    if (j >= n) continue;
    if (mcmf.adj_[ptap][i]->flow_ > 0) {
      int k = j;
      while (k != psink) {
        changes[k].push_back(make_pair(id, vals[k]));
        for (int(l) = 0; (l) < (((int)mcmf.adj_[k].size())); ++(l))
          if (mcmf.adj_[k][l]->flow_ > 0) {
            k = mcmf.adj_[k][l]->destination_;
            break;
          }
      }
      ++id;
    }
  }
  assert(id <= m);
  vector<string> ret;
  vector<int> values(m, -1);
  char buffer[1000];
  for (int(i) = 0; (i) < (n); ++(i)) {
    for (int(j) = 0; (j) < (((int)changes[i].size())); ++(j)) {
      if (values[changes[i][j].first] == changes[i][j].second) continue;
      sprintf(buffer, "%c=%d", (char)('a' + changes[i][j].first),
              changes[i][j].second);
      values[changes[i][j].first] = changes[i][j].second;
      ret.push_back(buffer);
    }
    for (int(j) = 0; (j) < (m); ++(j))
      if (values[j] == vals[i]) {
        sprintf(buffer, "print(%c)", (char)('a' + j));
        ret.push_back(buffer);
        break;
      }
  }
  cout << ((int)ret.size()) << " " << ans + n * 100000 << endl;
  for (int(i) = 0; (i) < (((int)ret.size())); ++(i)) {
    cout << ret[i] << endl;
  }
}