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 JAVA):

Solution:
import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		in.close();
		out.close();
	}

	int n, m, N;
	
	int flow[][];
	int cost[][];
	int cap[][];
	int phi[];
	int s, t;
	int used[];
	int tick;
	int dist[];
	RMQ rmq;
	int prev[];
	
	int sumFlow = 0;
	int sumCost = 0;
	
	private void solve() throws IOException{
		n = nextInt();
		m = nextInt();
		N = 2 * n + m + 2;
		flow = new int[N][N];
		cost = new int[N][N];
		cap = new int[N][N];
		phi = new int[N];
		used = new int[N];
		dist = new int[N];
		prev = new int[N];
		tick = 1;
		rmq = new RMQ(N);
		int val[] = new int[n];
		for(int i = 0; i < n; i++)
			val[i] = nextInt();
		
		for(int i = 0; i < n; i++)
			for(int j = i + 1; j < n; j++){
				cap[i][n + j] = 1;
				cost[i][n + j] = val[i] == val[j] ? 0 : Integer.bitCount(val[j]);
				cost[n + j][i] = -cost[i][n + j];
			}
		for(int i = 0; i < m; i++)
			for(int j = 0; j < n; j++){
				cap[2 * n + i][n + j] = 1;
				cost[2 * n + i][n + j] = Integer.bitCount(val[j]);
				cost[n + j][2 * n + i] = -cost[2 * n + i][n + j];
			}
		s = 2 * n + m;
		t = s + 1;
		for(int i = 0; i < n; i++) cap[s][i] = 1;
		for(int i = 0; i < m; i++) cap[s][2 * n + i] = 1;
		for(int i = 0; i < n; i++) cap[n + i][t] = 1;
		
		MinCostMaxFlow();
		chk(sumFlow == n);
		
		ArrayList<String> ans = new ArrayList<String>();
		
		int curVar[] = new int[n];
		for(int i = 0; i < n; i++){
			int prev = -1;
			for(int j = 0; j < N; j++)
				if(flow[j][n + i] == 1)
					prev = j;
			char pc;
			if(prev >= 2 * n){
				curVar[i] = prev - 2 * n;
				pc = (char)(curVar[i] + 'a');
				ans.add(pc + "=" + val[i]);
			} else {
				curVar[i] = curVar[prev];
				pc = (char)(curVar[i] + 'a');
				if(val[i] != val[prev])
					ans.add(pc + "=" + val[i]);
			}
			ans.add("print(" + pc + ")");
		}
		out.println(ans.size() + " " + sumCost);
		for(String s : ans)
			out.println(s);
		int sum = 0;
//		for(int i = 0; i < N; i++)
//			for(int j = 0; j < N; j++){
//				if(flow[i][j] <= 0) continue;
//				System.err.println(i + " " + j + " " + " || " + cost[i][j]);
//				sum += flow[i][j] > 0 ? flow[i][j] * cost[i][j] : 0;
//			}
//		System.err.println(sum);
	}
	int inf = Integer.MAX_VALUE >> 2;
	
	void chooseVertex(int i){
//		System.err.println(i);
		used[i] = tick;
		rmq.relax(i);
		for(int j = 0; j < N; j++)
			if(cap[i][j] > flow[i][j] && dist[j] > dist[i] + getWeight(i, j)){
				dist[j] = dist[i] + getWeight(i, j);
				rmq.relax(j);
				prev[j] = i;
			}
	}
			
			
	void deijkstra(){
		tick++;
		fill(dist, inf);
		dist[s] = 0;
		rmq.build();
		{
			int i = rmq.getMin();
			chooseVertex(i);
		}
		while(true){
			int i = rmq.getMin();
			if(used[i] == tick || dist[i] >= inf) return;
			chooseVertex(i);
		}
	}

	void MinCostMaxFlow(){
		while(true){
			int curCost = 0;
			deijkstra();
			if(used[t] != tick) return;
			sumFlow++;
			int cur = t;
//			System.err.println("------------");
			while(cur != s){
				int pr = prev[cur];
				curCost += cost[pr][cur];
//				System.err.println(cur + " | " + cost[pr][cur]);
				flow[pr][cur]++;
				flow[cur][pr]--;
				cur = pr;
			}
			chk(curCost == (dist[t] - phi[s] + phi[t]));
//			System.err.println(curCost + " " + (dist[t] - phi[s] + phi[t]));
			sumCost += curCost;
			for(int i = 0; i < N; i++)
				phi[i] += dist[i] == inf ? dist[t] : dist[i];
		}
	}
	
	int getWeight(int i, int j){
		int ret = cost[i][j] + phi[i] - phi[j];;
		chk(ret >= 0);
		return ret;
	}
	
	class RMQ{
		int c;
		int id[];
		RMQ(int size){
			c = size;
			id = new int[c << 1];
		}
		int bestId(int a, int b){
			if(used[a] == tick) return b;
			if(used[b] == tick) return a;
			return dist[a] < dist[b] ? a : b;
		}
		void build(){
			for(int i = 0; i < c; i++)
				id[i + c] = i;
			for(int i = c - 1; i > 0; i--)
				id[i] = bestId(id[i * 2], id[i * 2 + 1]);
		}
		
		void relax(int ind){
			ind += c;
			while(ind > 0){
				ind >>= 1;
				id[ind] = bestId(id[ind * 2], id[ind * 2 + 1]);
			}
		}
		int getMin(){
			return id[1];
		}
		
	}
	void chk(boolean b) {
		if (b)
			return;
		throw new RuntimeException();
	}
	void deb(String fmt, Object... args) {
		System.out.printf(Locale.US, fmt + "%n", args);
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}