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.*;
import java.awt.Point;
import java.math.BigDecimal;
import java.math.BigInteger;

import static java.lang.Math.*;

// Solution is at the bottom of code

public class E implements Runnable{
	
	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
	
	BufferedReader in;
	OutputWriter out;
	StringTokenizer tok = new StringTokenizer("");
	
	public static void main(String[] args){
		new Thread(null, new E(), "", 128 * (1L << 20)).start();
	}
	
	/////////////////////////////////////////////////////////////////////
	
	void init() throws FileNotFoundException{
		Locale.setDefault(Locale.US);
		
		if (ONLINE_JUDGE){
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new OutputWriter(System.out);
		}else{
			in = new BufferedReader(new FileReader("input.txt"));
			out = new OutputWriter("output.txt");
		}
	}
	
	////////////////////////////////////////////////////////////////
	
	long timeBegin, timeEnd;

	void time(){
		timeEnd = System.currentTimeMillis();
		System.err.println("Time = " + (timeEnd - timeBegin));
	}
	
	void debug(Object... objects){
		if (ONLINE_JUDGE){
			for (Object o: objects){
				System.err.println(o.toString());
			}
		}
	}
	
	/////////////////////////////////////////////////////////////////////
	
	public void run(){
		try{
			timeBegin = System.currentTimeMillis();
			Locale.setDefault(Locale.US);
			
			init();
			solve();
			
			out.close();
			time();
		}catch (Exception e){
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}
	
	/////////////////////////////////////////////////////////////////////
	
	String delim = " ";
	
	String readString() throws IOException{
		while(!tok.hasMoreTokens()){
			try{
				tok = new StringTokenizer(in.readLine());
			}catch (Exception e){
				return null;
			}
		}
		
		return tok.nextToken(delim);
	}
	
	String readLine() throws IOException{
		return in.readLine();
	}
	
	/////////////////////////////////////////////////////////////////
	
	final char NOT_A_SYMBOL = '\0';
	
	char readChar() throws IOException{
		int intValue = in.read();
		
		if (intValue == -1){
			return NOT_A_SYMBOL;
		}
		
		return (char) intValue;
	}
	
	char[] readCharArray() throws IOException{
		return readLine().toCharArray();
	}
	
	/////////////////////////////////////////////////////////////////
	
	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}
	
	int[] readIntArray(int size) throws IOException {
		int[] array = new int[size];
		
		for (int index = 0; index < size; ++index){
			array[index] = readInt();
		}
		
		return array;
	}
	
	int[] readSortedIntArray(int size) throws IOException {
		Integer[] array = new Integer[size];
		
		for (int index = 0; index < size; ++index) {
			array[index] = readInt();
		}
		Arrays.sort(array);
		
		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}
		
		return sortedArray;
	}
	
	int[] readIntArrayWithDecrease(int size) throws IOException {
		int[] array = readIntArray(size);
		
		for (int i = 0; i < size; ++i) {
			array[i]--;
		}
		
		return array;
	}
	
	///////////////////////////////////////////////////////////////////
	
	int[][] readIntMatrix(int rowsCount, int columnsCount) throws IOException {
		int[][] matrix = new int[rowsCount][];
		
		for (int rowIndex = 0; rowIndex < rowsCount; ++rowIndex) {
			matrix[rowIndex] = readIntArray(columnsCount);
		}
		
		return matrix;
	}
	
	int[][] readIntMatrixWithDecrease(int rowsCount, int columnsCount) throws IOException {
		int[][] matrix = new int[rowsCount][];
		
		for (int rowIndex = 0; rowIndex < rowsCount; ++rowIndex) {
			matrix[rowIndex] = readIntArrayWithDecrease(columnsCount);
		}
		
		return matrix;
	}
	
	///////////////////////////////////////////////////////////////////
	
	long readLong() throws IOException{
		return Long.parseLong(readString());
	}
	
	long[] readLongArray(int size) throws IOException{
		long[] array = new long[size];
		
		for (int index = 0; index < size; ++index){
			array[index] = readLong();
		}
		
		return array;
	}
	
	////////////////////////////////////////////////////////////////////
	
	double readDouble() throws IOException{
		return Double.parseDouble(readString());
	}
	
	double[] readDoubleArray(int size) throws IOException{
		double[] array = new double[size];
		
		for (int index = 0; index < size; ++index){
			array[index] = readDouble();
		}
		
		return array;
	}
	
	////////////////////////////////////////////////////////////////////
		
	BigInteger readBigInteger() throws IOException {
		return new BigInteger(readString());
	}
	
	BigDecimal readBigDecimal() throws IOException {
		return new BigDecimal(readString());
	}
	
	/////////////////////////////////////////////////////////////////////
	
	Point readPoint() throws IOException{
		int x = readInt();
		int y = readInt();
		return new Point(x, y);
	}
	
	Point[] readPointArray(int size) throws IOException{
		Point[] array = new Point[size];
		
		for (int index = 0; index < size; ++index){
			array[index] = readPoint();
		}
		
		return array;
	}
	
	/////////////////////////////////////////////////////////////////////
	
	List<Integer>[] readGraph(int vertexNumber, int edgeNumber)
	throws IOException{
		@SuppressWarnings("unchecked")
		List<Integer>[] graph = new List[vertexNumber];
		
		for (int index = 0; index < vertexNumber; ++index){
			graph[index] = new ArrayList<Integer>();
		}
		
		while (edgeNumber-- > 0){
			int from = readInt() - 1;
			int to = readInt() - 1;
			
			graph[from].add(to);
			graph[to].add(from);
		}
		
		return graph;
	}
	
	/////////////////////////////////////////////////////////////////////
	
	static class IntIndexPair {
		
		static Comparator<IntIndexPair> increaseComparator = new Comparator<E.IntIndexPair>() {
			
			@Override
			public int compare(IntIndexPair indexPair1, IntIndexPair indexPair2) {
				int value1 = indexPair1.value;
				int value2 = indexPair2.value;
				
				if (value1 != value2) return value1 - value2;
				
				int index1 = indexPair1.index;
				int index2 = indexPair2.index;
				
				return index1 - index2;
			}
		};
		
		static Comparator<IntIndexPair> decreaseComparator = new Comparator<E.IntIndexPair>() {
			
			@Override
			public int compare(IntIndexPair indexPair1, IntIndexPair indexPair2) {
				int value1 = indexPair1.value;
				int value2 = indexPair2.value;
				
				if (value1 != value2) return -(value1 - value2);
				
				int index1 = indexPair1.index;
				int index2 = indexPair2.index;
				
				return index1 - index2;
			}
		};
		
		int value, index;

		public IntIndexPair(int value, int index) {
			super();
			this.value = value;
			this.index = index;
		}		
		
		public int getRealIndex() {
			return index + 1;
		}
	}
	
	IntIndexPair[] readIntIndexArray(int size) throws IOException {
		IntIndexPair[] array = new IntIndexPair[size];
		
		for (int index = 0; index < size; ++index) {
			array[index] = new IntIndexPair(readInt(), index);
		}
		
		return array;
	}
	
	/////////////////////////////////////////////////////////////////////
	
	static class OutputWriter extends PrintWriter {

		final int DEFAULT_PRECISION = 12;
		
		protected int precision;
		protected String format, formatWithSpace;
		
		{
			precision = DEFAULT_PRECISION;
			
			format = createFormat(precision);
			formatWithSpace = format + " ";
		}
		
		public OutputWriter(OutputStream out) {
			super(out);
		}

		public OutputWriter(String fileName) throws FileNotFoundException {
			super(fileName);
		}
		
		public int getPrecision() {
			return precision;
		}

		public void setPrecision(int precision) {
			precision = max(0, precision);
			this.precision = precision;
			
			format = createFormat(precision);
			formatWithSpace = format + " ";
		}
		
		private String createFormat(int precision){
			return "%." + precision + "f";
		}
		
		@Override
		public void print(double d){
			printf(format, d);
		}
		
		public void printWithSpace(double d){
			printf(formatWithSpace, d);
		}

		public void printAll(double...d){
			for (int i = 0; i < d.length - 1; ++i){
				printWithSpace(d[i]);
			}
			
			print(d[d.length - 1]);
		}
		
		@Override
		public void println(double d){
			printlnAll(d);
		}
		
		public void printlnAll(double... d){
			printAll(d);
			println();
		}
	}
	
	/////////////////////////////////////////////////////////////////////
	
	static final int[][] steps = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; 
	static final int[][] steps8 = {
			{-1, 0}, {1, 0}, {0, -1}, {0, 1},
			{-1, -1}, {1, 1}, {1, -1}, {-1, 1}
	};
	
	static final boolean check(int index, int lim){
		return (0 <= index && index < lim);
	}
	
	/////////////////////////////////////////////////////////////////////
	
	static final boolean checkBit(int mask, int bit){
		return (mask & (1 << bit)) != 0;
	}
	
	/////////////////////////////////////////////////////////////////////
	
	static final long getSum(int[] array) {
		long sum = 0;
		for (int value: array) {
			sum += value;
		}
		
		return sum;
	}
	
	static final Point getMinMax(int[] array) {
		int min = array[0];
		int max = array[0];
		
		for (int index = 0, size = array.length; index < size; ++index, ++index) {
			int value = array[index];
			
			if (index == size - 1) {
				min = min(min, value);
				max = max(max, value);
			} else {
				int otherValue = array[index + 1];
				
				if (value <= otherValue) {
					min = min(min, value);
					max = max(max, otherValue);
				} else {
					min = min(min, otherValue);
					max = max(max, value);
				}
			}
		}
		
		return new Point(min, max);
	}
	
	/////////////////////////////////////////////////////////////////////
	
	class Edge {
		int from, to;
		int flow, capacity;
		int cost;
		
		Edge reverseEdge;

		public Edge(int from, int to, int capacity, int cost) {
			super();
			this.from = from;
			this.to = to;
			
			this.flow = 0;
			this.capacity = capacity;
			
			this.cost = cost;
		}
		
		public Edge setReverseEdge(Edge reverseEdge) {
			this.reverseEdge = reverseEdge;
			
			return this;
		}
	}
	
	List<Edge>[] graph;
	List<Edge> edges;
	
	@SuppressWarnings("unchecked")
	void solve() throws IOException {
		int arraySize = readInt();
		int variablesCount = readInt();
		
		int graphSize = variablesCount + 2 * (arraySize) + 2;
		
		int start = graphSize - 2;
		int end = start + 1;
		
		graph = new List[graphSize];
		for (int v = 0; v < graphSize; ++v) {
			graph[v] = new ArrayList<E.Edge>();
		}
		
		edges = new ArrayList<E.Edge>();
		
		int[] array = readIntArray(arraySize);
		
		int[] bitCounts = new int[arraySize];
		for (int index = 0; index < arraySize; ++index) {
			bitCounts[index] = Integer.bitCount(array[index]);
		}
		
		int variableStart = 0, variableEnd = variableStart + variablesCount - 1;
		int reAssignElementStart = variableEnd + 1, reAssignElementEnd = reAssignElementStart + arraySize - 1;
		int assignElementStart = reAssignElementEnd + 1, assignElementEnd = assignElementStart + arraySize - 1;
		
		for (int variable = variableStart; variable <= variableEnd; ++variable) {
			addEdge(start, variable, 0);
			
			for (int index = 0, assignElement = assignElementStart; index < arraySize && assignElement <= assignElementEnd; ++index, ++assignElement) {
				addEdge(variable, assignElement, bitCounts[index]);
			}
		}
		
		for (int index = 0, reAssignElement = reAssignElementStart; index < arraySize && reAssignElement <= reAssignElementEnd; ++index, ++reAssignElement) {
			addEdge(start, reAssignElement, 0);
			
			int value = array[index];
			for (int otherIndex = index + 1, assignElement = assignElementStart + index + 1; otherIndex < arraySize && assignElement <= assignElementEnd; ++otherIndex, ++assignElement) {
				int cost = (value == array[otherIndex] ? 0 : bitCounts[otherIndex]);
				addEdge(reAssignElement, assignElement, cost);
			}
		}
		
		for (int assignElement = assignElementStart; assignElement <= assignElementEnd; ++assignElement) {
			addEdge(assignElement, end, 0);
		}
		
		Collections.sort(
				edges,
				new Comparator<Edge>() {

					@Override
					public int compare(Edge first, Edge second) {
						return first.cost - second.cost;
					}
					
				}
		);
		
		int totalCost = minCostMaxFlow(start, end);
		
		int[] usedVariables = new int[arraySize];
		
		List<Point> answer = new ArrayList<Point>();
		for (int index = 0, assignElement = assignElementStart; index < arraySize && assignElement <= assignElementEnd; ++index, ++assignElement) {
			for (Edge edge : graph[assignElement]) {
				if (edge.flow == 0 || edge.capacity > 0) continue;
				// we need only reverse edges
				
				int to = edge.to;
				if (variableStart <= to && to <= variableEnd) {
					int variable = to - variableStart;
					usedVariables[index] = variable;
					
					answer.add(new Point(usedVariables[index], index));
				}
				
				if (reAssignElementStart <= to && to <= reAssignElementEnd) {
					int prev = to - reAssignElementStart;
					usedVariables[index] = usedVariables[prev];
					
					if (array[prev] != array[index]) {
						answer.add(new Point(usedVariables[index], index));
					}
				}
				
				answer.add(new Point(usedVariables[index], -1));
			}
		}
		
		out.println(answer.size() + " " + totalCost);
		for (Point operation : answer) {
			char variable = (char) (operation.x + 'a');
			int index = operation.y;
			
			if (index == -1) {
				out.println("print(" + variable + ")");
			} else {
				out.println(variable + "=" + array[index]);
			}
		}
	}
	
	int[] distances;
	int[] maxFlows;
	Edge[] parentEdges;
	
	int[] parents;
	
	int[] first;
	
	int[] next;
	int[] prev;
	
	int[] last;
	
	Trie trie;
	
	int minCostMaxFlow(int start, int end) {
		int totalCost = 0;
		
		this.distances = new int[graph.length];
		this.parentEdges = new Edge[graph.length];
		this.maxFlows = new int[graph.length];
		
		trie = new Trie(graph.length);
		
		for (int curCost = fordBellman(start, end); curCost != INF; curCost = fordBellman(start, end)) {
			totalCost += curCost;
		}
		
		return totalCost;
	}
	
	final int INF = Integer.MAX_VALUE / 3;
	
	class Trie {

		
		public Trie(int n) {
			first = new int[n];
			
			next = new int[n];
			prev = new int[n];
			
			last = new int[n];
			
			parents = new int[n];
			
			Arrays.fill(first, -1);
			Arrays.fill(next, -1);
			Arrays.fill(last, -1);
			Arrays.fill(prev, -1);
			Arrays.fill(parents, -1);
		}
		
		public void clear() {

			Arrays.fill(first, -1);
			Arrays.fill(next, -1);
			Arrays.fill(last, -1);
			Arrays.fill(prev, -1);
			Arrays.fill(parents, -1);
		}
		
		public void updateDistances(int v) {
			for (int child = first[v]; child != -1; child = next[child]) {
				distances[child] = distances[v] + parentEdges[child].cost;
				
				updateDistances(child);
			}
		}
		
		public void setParent(int parent, int cur) {
			if (prev[cur] != -1) {
				next[prev[cur]] = next[cur];
			} else if (parents[cur] != -1 && cur == first[parents[cur]]) {
				first[parents[cur]] = next[cur];
			}
			
			if (next[cur] != -1) {
				prev[next[cur]] = prev[cur];
			} else if (parents[cur] != -1 && cur == last[parents[cur]]) {
				last[parents[cur]] = prev[cur];
			}
			
			prev[cur] = -1;
			next[cur] = -1;
			
			parents[cur] = parent;
			
			if (first[parent] == -1) {
				first[parent] = cur;
				last[parent] = cur;
			} else {
				prev[cur] = last[parent];
				next[last[parent]] = cur;
				
				last[parent] = cur;
			}
		}
	}
	
	int fordBellman(int start, int end) {
		int graphSize = graph.length;
		
//		Trie trie = new Trie(graphSize);
		trie.clear();
		
		Arrays.fill(distances, INF);
		Arrays.fill(parentEdges, null);
		Arrays.fill(maxFlows, INF);
		
		distances[start] = 0;
		for (int it = 0; it < graphSize; ++it) {
			boolean changed = false;
			
			for (Edge edge : edges) {
				if (edge.flow == edge.capacity) continue;
				
				int from = edge.from;
				int to = edge.to;
				
				if (distances[to] > distances[from] + edge.cost) {
					distances[to] = distances[from] + edge.cost;
					
					parentEdges[to] = edge;
					trie.setParent(from, to);
					
					maxFlows[to] = min(maxFlows[from], edge.capacity - edge.flow);
					
					trie.updateDistances(to);
				
					changed = true;
				}
			}
			
			if (!changed) break;
		}
		
		if (distances[end] == INF) return INF;
		
		int endFlow = maxFlows[end];
		int curCost = 0;
		
		for (int cur = end; parentEdges[cur] != null; cur = parentEdges[cur].from) {
			Edge parentEdge = parentEdges[cur];
			parentEdge.flow += endFlow;
			
			curCost += parentEdge.cost * endFlow;
			
			Edge reverseEdge = parentEdge.reverseEdge;
			reverseEdge.flow -= endFlow;
		}
		
		
		return curCost;
	}
	
	void addEdge(int from, int to, int cost) {
		Edge fromToEdge = new Edge(from, to, 1, cost);
		Edge toFromEdge = new Edge(to, from, 0, -cost);
		
		graph[from].add(fromToEdge.setReverseEdge(toFromEdge));
		graph[to].add(toFromEdge.setReverseEdge(fromToEdge));
		
		edges.add(fromToEdge);
		edges.add(toFromEdge);
	}
}