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 java.util.*;
import java.io.*;
public class CodeforcesE132 {
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		int n = br.nextInt();
		int m = br.nextInt();
		int[] nums = new int[n];
		for(int i = 0;i<n;i++){
			nums[i] = br.nextInt();
		}
		
		MinCostFlow mcf = new MinCostFlow(2*n+1);
		mcf.add(mcf.source, 2*n, m, 0);
		for(int i = 0;i<n;i++){
			mcf.add(i, i+n, 1, -1000000);
			mcf.add(2*n, i, 1, Integer.bitCount(nums[i]));
			for(int j = i+1;j<n;j++){
				int cost = Integer.bitCount(nums[j]);
				if(nums[i] == nums[j]){
					cost = 0;
				}
				mcf.add(i+n, j, 1, cost);
			}
			mcf.add(i+n, mcf.sink, 1, 0);
		}
		
		long res = mcf.minCostFlow();
		long cost = res+n*1000000;
//		System.out.println(res);
		int[] var = new int[n];
		Arrays.fill(var, -1);
		int count = 0;
		for(MinCostFlow.Edge e : mcf.adj[2*n]){
			if(e.end < n && e.capacity == 0){
				var[e.end] = count;
				
				int pos = e.end+n;
				while(true){
					boolean found = false;
					for(MinCostFlow.Edge ee : mcf.adj[pos]){
						if(ee.end < n && ee.capacity == 0 && ee.end != pos-n){
							pos = ee.end+n;
							found = true;
							break;
						}
					}
					
					if(!found){
						break;
					}
					var[pos-n] = count;
				}
				count++;
			}
			
		}
		ArrayList<String> oo = new ArrayList<String>();
		int[] val = new int[m];
		for(int i = 0;i<n;i++){
			if(val[var[i]] != nums[i]){
				oo.add((char)('a'+var[i])+"="+nums[i]);
				val[var[i]] = nums[i];
			}
			oo.add("print("+(char)('a'+var[i])+")");
		}
		
		PrintWriter out = new PrintWriter(System.out);
		out.println(oo.size() +" "+cost);
		for(String s : oo){
			out.println(s);
		}
		out.close();
	}
	public static class MinCostFlow
	{
		public static final long INF1 = 1000000000;
		public static final long INF2 = 100000000;
		
		public ArrayList<Edge>[] adj;
		public int source;
		public int sink;
		public int metaSource;
		public int metaSink;
		public Edge[] prev;
		public long[] width;
		public long[] pi;
		
		public MinCostFlow(int n)
		{
			source = n++;
			sink = n++;
			metaSource = n++;
			metaSink = n++;
			
			adj = new ArrayList[n];
			for(int i = 0; i < adj.length; i++)
			{
				adj[i] = new ArrayList<Edge>();
			}
		}
		
		public Edge add(int a, int b, long cap, long c)
		{
			Edge e1 = new Edge(a, b, cap, c);
			Edge e2 = new Edge(b, a, 0, -c);
			e1.rev = e2;
			e2.rev = e1;
			adj[a].add(e1);
			adj[b].add(e2);
			
			return e1;
		}
		
		public long[] minCostMaxFlowNegCycles()
		{
			Edge flow = add(sink, source, INF1, -INF2);
			
			long cost = minCostFlow();
			
			return new long[] {INF1 - flow.capacity, cost + INF2 * (INF1 - flow.capacity)};
		}
		
		public long minCostFlow()
		{
			long result = 0;
			long[] val = new long[adj.length];
			for(int i = 0; i < adj.length; i++)
			{
				for(Edge e : adj[i])
				{
					if(e.capacity > 0 && e.cost < 0)
					{
						result += e.capacity * e.cost;
						val[e.start] -= e.capacity;
						val[e.end] += e.capacity;
						e.rev.capacity = e.capacity;
						e.capacity = 0;
					}
				}
			}
			
			for(int i = 0; i < val.length; i++)
			{
				if(val[i] > 0)
				{
					add(metaSource, i, val[i], 0);
				}
				else if(val[i] < 0)
				{
					add(i, metaSink, -val[i], 0);
				}
			}
			add(sink, source, 1000, 0);
			source = metaSource;
			sink = metaSink;
			return result + minCostMaxFlow()[1];
		}
		
		public long[] minCostMaxFlow()
		{
			long flow = 0;
			long cost = 0;
			
			getPotential();
			
			while(findPath())
			{
				flow += width[sink];
				cost += update();
			}
			
			return new long[] {flow, cost};
		}
		
		public void getPotential()
		{
			pi = new long[adj.length];
			Arrays.fill(pi, INF1);
			pi[source] = 0;
			
			for(int i = 0; i < adj.length - 1; i++)
			{
				boolean update = false;
				for(int j = 0; j < adj.length; j++)
				{
					for(Edge e : adj[j])
					{
						if(e.capacity > 0 && pi[e.start] + e.cost < pi[e.end])
						{
							pi[e.end] = pi[e.start] + e.cost;
							update = true;
						}
					}
				}
				
				if(!update)
				{
					break;
				}
			}
		}
		
		public boolean findPath()
		{
			long[] dist = new long[adj.length];
			Arrays.fill(dist, INF1);
			dist[source] = 0;
			
			prev = new Edge[adj.length];
			
			width = new long[adj.length];
			Arrays.fill(width, INF1);
			
			PriorityQueue<Node> pq = new PriorityQueue<Node>();
			pq.add(new Node(source, 0));
			
			while(pq.size() > 0)
			{
				Node node = pq.poll();
				
				if(node.dist == dist[node.index])
				{
					for(Edge e : adj[node.index])
					{
						long newDist = dist[node.index] + e.cost + pi[e.start] - pi[e.end];
						if(e.capacity > 0 && newDist < dist[e.end])
						{
							dist[e.end] = newDist;
							prev[e.end] = e;
							width[e.end] = Math.min(width[node.index], e.capacity);
							pq.add(new Node(e.end, newDist));
						}
					}
				}
			}
			
			for(int i = 0; i < pi.length; i++)
			{
				pi[i] += dist[i];
			}
			
			return (dist[sink] < INF1);
		}
		
		public long update()
		{
			int node = sink;
			long current = 0;
			while(prev[node] != null)
			{
				prev[node].capacity -= width[sink];
				prev[node].rev.capacity += width[sink];
				current += width[sink] * prev[node].cost;
				node = prev[node].start;
			}
			
			return current;
		}
		
		static class Edge
		{
			int start;
			int end;
			long capacity;
			long cost;
			Edge rev;
			
			public Edge(int s, int e, long cap, long c)
			{
				start = s;
				end = e;
				capacity = cap;
				cost = c;
			}
		}
		
		static class Node implements Comparable<Node>
		{
			int index;
			long dist;
			
			public Node(int i, long d)
			{
				index = i;
				dist = d;
			}
			
			public int compareTo(Node o)
			{
				return Long.compare(dist, o.dist);
			}
		}
	}
}