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 minCostMaxFlow(int start, int end) {
		int totalCost = 0;
		
		int[] phi = new int[graph.length];
		fordBellman(start, phi);
		
		for (int curCost = dijkstra(start, end, phi); curCost != INF; curCost = dijkstra(start, end, phi)) {
			totalCost += curCost;
		}
		
		return totalCost;
	}
	
	/*
	 * 
	 * 416 740
j=657
print(j)
j=626
print(j)
b=412
print(b)
d=514
print(d)
f=482
print(f)
g=844
print(g)
print(b)
i=466
print(i)
i=55
print(i)
print(d)
a=341
print(a)
a=339
print(a)
print(j)
g=467
print(g)
h=71
print(h)
c=205
print(c)
print(g)
c=445
print(c)
e=33
print(e)
print(d)
e=906
print(e)
e=196
print(e)
d=64
print(d)
d=604
print(d)
print(c)
print(b)
b=460
print(b)
d=202
print(d)
b=971
print(b)
d=142
print(d)
print(a)
print(e)
b=286
print(b)
print(i)
print(d)
print(c)
print(d)
c=344
print(c)
d=928
print(d)
a=724
print(a)
i=586
print(i)
print(j)
j=36
print(j)
d=274
print(d)
print(g)
a=130
print(a)
g=767
print(g)
print(b)
j=77
print(j)
a=256
print(a)
print(g)
print(i)
print(i)
g=444
print(g)
d=735
print(d)
i=519
print(i)
print(e)
d=383
print(d)
print(c)
e=632
print(e)
a=382
print(a)
i=872
print(i)
print(f)
g=733
print(g)
f=647
print(f)
f=104
print(f)
print(h)
h=257
print(h)
print(a)
a=458
print(a)
a=256
print(a)
a=299
print(a)
print(i)
print(g)
a=407
print(a)
a=929
print(a)
print(f)
f=505
print(f)
print(e)
f=880
print(f)
f=274
print(f)
f=284
print(f)
f=541
print(f)
f=635
print(f)
print(j)
print(h)
print(d)
f=600
print(f)
h=443
print(h)
f=33
print(f)
print(c)
j=32
print(j)
j=315
print(j)
f=163
print(f)
f=640
print(f)
print(d)
f=717
print(f)
d=37
print(d)
c=906
print(c)
print(i)
print(b)
d=960
print(d)
print(d)
print(e)
d=844
print(d)
i=142
print(i)
b=255
print(b)
i=982
print(i)
d=341
print(d)
print(b)
print(e)
b=467
print(b)
d=320
print(d)
d=55
print(d)
e=205
print(e)
print(g)
g=180
print(g)
print(b)
print(f)
print(a)
g=640
print(g)
print(c)
c=735
print(c)
g=344
print(g)
a=626
print(a)
print(b)
g=694
print(g)
f=10
print(f)
a=590
print(a)
f=444
print(f)
print(d)
d=928
print(d)
d=193
print(d)
d=519
print(d)
print(c)
print(i)
i=977
print(i)
i=482
print(i)
i=64
print(i)
i=32
print(i)
d=604
print(d)
print(e)
d=171
print(d)
d=960
print(d)
i=280
print(i)
print(c)
d=504
print(d)
d=320
print(d)
print(g)
d=299
print(d)
print(g)
d=154
print(d)
g=647
print(g)
d=566
print(d)
d=724
print(d)
print(i)
d=600
print(d)
i=445
print(i)
print(j)
d=220
print(d)
d=560
print(d)
print(h)
d=466
print(d)
d=788
print(d)
d=274
print(d)
d=880
print(d)
d=163
print(d)
print(d)
d=412
print(d)
d=285
print(d)
print(i)
print(c)
i=33
print(i)
print(e)
i=193
print(i)
print(e)
i=657
print(i)
i=36
print(i)
i=422
print(i)
print(b)
b=30
print(b)
b=906
print(b)
e=421
print(e)
print(a)
e=83
print(e)
a=773
print(a)
e=320
print(e)
print(j)
print(f)
a=32
print(a)
f=223
print(f)
print(h)
f=33
print(f)
print(e)
f=844
print(f)
a=171
print(a)
print(d)
print(g)
h=929
print(h)
f=274
print(f)
print(a)
d=196
print(d)
a=570
print(a)
f=541
print(f)
f=604
print(f)
d=466
print(d)
d=712
print(d)
d=880
print(d)
print(e)
print(f)
print(j)
j=504
print(j)
f=383
print(f)
f=458
print(f)
f=264
print(f)
j=514
print(j)
j=339
print(j)
j=828
print(j)
print(i)
j=600
print(j)
i=982
print(i)
print(j)
i=143
print(i)
print(c)
print(b)
print(f)
b=460
print(b)
print(g)
print(e)
print(j)
i=32
print(i)
c=788
print(c)
b=196
print(b)
print(d)
b=519
print(b)
j=36
print(j)
f=10
print(f)
j=624
print(j)
j=445
print(j)
b=767
print(b)
f=55
print(f)
j=163
print(j)
print(a)
c=104
print(c)
d=977
print(d)
print(h)
i=566
print(i)
g=500
print(g)
b=30
print(b)
print(e)

	 * 
	 */
	
	final int INF = 1000000;//Integer.MAX_VALUE / 3;
	
	void fordBellman(int start, int[] distances) {
		int graphSize = graph.length;
		
		Arrays.fill(distances, 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[from] == INF) continue;
				
				if (distances[to] > distances[from] + edge.cost) {
					distances[to] = distances[from] + edge.cost;
				
					changed = true;
				}
			}
			
			if (!changed) break;
		}
	}
	
	int dijkstra(int start, int end, int[] phi) {
		int graphSize = graph.length;
		
		int[] distances = new int[graphSize];
		Arrays.fill(distances, INF);
		
		Edge[] parentEdges = new Edge[graphSize];
		
		int[] maxFlows = new int[graphSize];
		Arrays.fill(maxFlows, INF);
		
		boolean[] used = new boolean[graphSize];
		
		distances[start] = 0;
		for (int iteration = 0; iteration < graphSize; ++iteration) {
			int from = -1;
			
			for (int v = 0; v < graphSize; ++v) {
				if (!used[v] && distances[v] < INF && (from == -1 || distances[from] > distances[v])) {
					from = v;
				}
			}
			
			if (from == -1) break;
			used[from] = true;
			
			for (Edge edge : graph[from]) {
				if (edge.flow < edge.capacity) {
					int to = edge.to;
					
					if (!used[to] && distances[to] > distances[from] + phi[from] - phi[to] + edge.cost) {
						distances[to] = distances[from] + phi[from] - phi[to] + edge.cost;
						parentEdges[to] = edge;
						maxFlows[to] = min(maxFlows[from], edge.capacity - edge.flow);
					}
				}
			}
		}
		
		if (distances[end] == INF) return INF;
		
		for (int v = 0; v < graphSize; ++v) {
			phi[v] += used[v] ? distances[v] : distances[end];
		}
		
		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);
	}
}