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.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class Main{
    public static void main(String[]args){
        InputStream in = System.in;
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        try{
            //          in = new BufferedInputStream(new FileInputStream(new File("input.txt")));
            //          out = new PrintWriter(new BufferedOutputStream(new FileOutputStream("output.txt")));
        }catch (Exception e) {
        }
        new Main().run(in,out);
        out.flush();
    }
    private void debug(Object...os){
//      System.err.println(deepToString(os));
    }

    private void run(InputStream in,PrintWriter out){
        int n = nextInt(in);
        int m = nextInt(in);
        PrimalDual_negative pd = new PrimalDual_negative(n);
        HashMap<Integer, Integer> last = new HashMap<Integer, Integer>();
        int[] is=new int[n];
        int[]rem=new int[n];
        fill(rem,-1);
        int r = 0;
        for (int i = 0; i < n; i++) {
            is[i]=nextInt(in);
            if(last.containsKey(is[i])){
                if(last.get(is[i])==i-1){
                    rem[i-1] =i;
                    r -= Integer.bitCount(is[i]);
                }else{
                    pd.make(last.get(is[i])+1, i, 1, -Integer.bitCount(is[i]));
                }
            }
            last.put(is[i], i);
        }
        for (int i = 0; i < n-1; i++) {
            pd.make(i, i+1, m+2, 0);
        }
        debug("a");
        long min = pd.minCostFlow(0, n-1, m-1);
        debug("b");
        debug(min);
//      System.out.println(min);
        ArrayList<String>res=new ArrayList<String>();
        V[] vs = pd.vs;
        for (int i = 0; i < n; i++) {
            for(E e:vs[i].es)if(e.CAP==1){
                debug(i,e.to.id,e.cap);
                if(e.cap==0){
                    rem[i-1] = e.to.id;
                }
            }
        }
//      debug(rem);
        int[] as=new int[m];
        int[] to=new int[m];
        fill(to,-1);
        for (int i = 0; i < n; i++) {
            boolean found = false;
            for (int j = 0; j < m; j++) {
                if(is[i]==as[j]){
                    found=true;
                    to[j] = rem[i];
                    res.add(print(j));
                    break;
                }
            }
            if(!found){
                for(int j=0;j<m;j++){
                    if(to[j]==-1){
                        as[j] = is[i];
                        res.add(rem(j,is[i]));
                        to[j] = rem[i];
                        res.add(print(j));
                        found=true;break;
                    }
                }
            }
            if(!found)throw new RuntimeException();
        }
        r += (int)min;
        for(int t:is)r+=Integer.bitCount(t);
        out.println(res.size()+" "+r);
        for(String t:res)out.println(t);
    }


    private String rem(int j, int v) {
        return ((char)(j+'a'))+"="+v;
    }
    private String print(int j) {
        return "print(" +((char)(j+'a')) +")";
    }


    class V implements Comparable<V>{
        int id;
        boolean visited;
        ArrayList<E> es = new ArrayList<E>();
        E bef;
        long cost;
        long potential;
        public int compareTo(V o) {
            if(id==o.id)return 0;
            int res = Long.signum(cost - o.cost);
            return res==0 ? id-o.id : res;
        }
        V(int id){
            this.id=id;
        }
    }
    class E{
        E rev;
        V to;
        int CAP;
        int cap;
        long cost;
        public E(V to, int cap, long cost) {
            this.to = to;
            this.CAP = cap;
            this.cap = cap;
            this.cost = cost;
        }
    }

    class PrimalDual_negative{
        static final long INF = 1L<<60;
        int n;
        V[] vs;

        PrimalDual_negative(int nn){
            n=nn;
            vs=new V[n];
            for(int i=0;i<n;i++)vs[i]=new V(i);
        }

        void make(int from,int to,int cap,long cost){
            E e = new E(vs[to], cap, cost);
            E r = new E(vs[from],0,-cost);
            e.rev = r;
            r.rev = e;
            vs[from].es.add(e);
            vs[to].es.add(r);
        }

        long minCostFlow(int from,int to,int flow){
            V s = vs[from],t = vs[to];
            calcInitialPotential(from);
            long res = 0;
            TreeSet<V> que = new TreeSet<V>();
            while(flow>0){
                for(V v:vs)v.cost = INF;
                for(V v:vs)v.visited = false;
                s.cost = 0;
                s.bef=null;
                t.bef=null;
                que.add(s);
                while(!que.isEmpty()){
                    V v = que.first();
                    que.remove(v);
                    if(v.visited)continue;
                    v.visited=true;
                    for(E e:v.es)if(e.cap>0 && !e.to.visited){
                        if(e.to.cost > v.cost + e.cost + v.potential - e.to.potential){
                            if(que.contains(e.to))que.remove(e.to);
                            e.to.cost = v.cost + e.cost + v.potential - e.to.potential;
                            e.to.bef = e;
                            que.add(e.to);
                        }
                    }
                }
                if(t.bef==null)return -1;
                for(V v:vs)v.potential += v.cost;
                int min=flow;
                for(E e=t.bef;e!=null;e=e.rev.to.bef){
                    min=min(min,e.cap);
                }
                for(E e=t.bef;e!=null;e=e.rev.to.bef){
                    e.cap -= min;
                    res += e.cost*min;
                    e.rev.cap += min;
                }
                flow -= min;
            }
            return res;
        }

        private void calcInitialPotential(int from) {
            for(V v:vs)v.potential=INF;
            vs[from].potential=0;
            for(;;){
                boolean updated=false;
                for(V v:vs)for(E e:v.es)if(e.cap>0){
                    if(e.to.potential > e.cost + v.potential){
                        updated=true;
                        e.to.potential = e.cost + v.potential;
                    }
                }
                if(!updated)break;
            }
        }
    }

    private String next(InputStream in) {
        try {
            StringBuilder res = new StringBuilder("");
            int c = in.read();
            while (Character.isWhitespace(c))
                c = in.read();
            do {
                res.append((char) c);
            } while (!Character.isWhitespace(c = in.read()));
            return res.toString();
        } catch (Exception e) {
            return null;
        }
    }

    private int nextInt(InputStream in){
        try{
            int c=in.read();
            if(c==-1) return c;
            while(c!='-'&&(c<'0'||'9'<c)){
                c=in.read();
                if(c==-1) return c;
            }
            if(c=='-') return -nextInt(in);
            int res=0;
            do{
                res*=10;
                res+=c-'0';
                c=in.read();
            }while('0'<=c&&c<='9');
            return res;
        }catch(Exception e){
            return -1;
        }
    }

    private long nextLong(InputStream in){
        try{
            int c=in.read();
            if(c==-1) return c;
            while(c!='-'&&(c<'0'||'9'<c)){
                c=in.read();
                if(c==-1) return c;
            }
            if(c=='-') return -nextLong(in);
            long res=0;
            do{
                res*=10;
                res+=c-'0';
                c=in.read();
            }while('0'<=c&&c<='9');
            return res;
        }catch(Exception e){
            return -1;
        }
    }
}