Problem: General Payne has a battalion of n soldiers. The soldiers' beauty contest is coming up, it will last for k days. Payne decided that his battalion will participate in the pageant. Now he has choose the participants.

All soldiers in the battalion have different beauty that is represented by a positive integer. The value ai represents the beauty of the i-th soldier.

On each of k days Generals has to send a detachment of soldiers to the pageant. The beauty of the detachment is the sum of the beauties of the soldiers, who are part of this detachment. Payne wants to surprise the jury of the beauty pageant, so each of k days the beauty of the sent detachment should be unique. In other words, all k beauties of the sent detachments must be distinct numbers.

Help Payne choose k detachments of different beauties for the pageant. Please note that Payne cannot just forget to send soldiers on one day, that is, the detachment of soldiers he sends to the pageant should never be empty.

Input

The first line contains two integers n, k (1 ≤ n ≤ 50; 1 ≤ k ≤  <image>) — the number of soldiers and the number of days in the pageant, correspondingly. The second line contains space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 107) — the beauties of the battalion soldiers.

It is guaranteed that Payne's battalion doesn't have two soldiers with the same beauty.

Output

Print k lines: in the i-th line print the description of the detachment that will participate in the pageant on the i-th day. The description consists of integer ci (1 ≤ ci ≤ n) — the number of soldiers in the detachment on the i-th day of the pageant and ci distinct integers p1, i, p2, i, ..., pci, i — the beauties of the soldiers in the detachment on the i-th day of the pageant. The beauties of the soldiers are allowed to print in any order.

Separate numbers on the lines by spaces. It is guaranteed that there is the solution that meets the problem conditions. If there are multiple solutions, print any of them.

Examples

Input

3 3
1 2 3


Output

1 1
1 2
2 3 2


Input

2 1
7 12


Output

1 12 

Solution (in JAVA):

Solution:
import java.util.Arrays;
import java.util.Scanner;

public class program {

    public static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n = in.nextInt();
        int k = in.nextInt();
        int a[] = new int[n];
        for (int i = 0; i < n; ++i) {
            a[i] = in.nextInt();
        }

        Arrays.sort(a);

        int result[][] = new int[n][n*(n+1)/2 + 1];

        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < k; ++j) {
                result[i][j] = 0;
            }
        }

        if (k <= n) {
            for (int i = 0; i < k; ++i) {
                System.out.println("1 " + a[i]);
            }
            return;
        }

        int tmp = 0;
        int ind = n;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < ind; ++j) {
                result[i][tmp + j] = a[j];
            }
            for (int z = tmp + ind; z < k; ++z) {
                result[i][z] = a[ind - 1];
            }
            tmp += ind;
            ind--;
        }

        int nums[] = new int[k];
        Arrays.fill(nums, 0);
        for (int i = 0; i < k; ++i) {
            for (int j = 0; j < n; ++j) {
                if (result[j][i] != 0) {
                    nums[i]++;
                } else {
                    break;
                }
            }
        }

        for (int i = 0; i < k; ++i) {
            System.out.print(nums[i]);
            for (int j = 0; j < nums[i]; ++j) {
                System.out.print(" " + result[j][i]);
            }
            System.out.println();
        }

        /*int k = in.nextInt();
        int a[] = new int[n];

        for (int i = 0; i < n; ++i) {
            a[i] = in.nextInt();
        }

        if (k == 1) {
            for (int i = 0; i < n - 1; ++i) {
                System.out.println(a[i] + " ");
            }
            System.out.println(a[n - 1]);
        }*/

        /*Q = in.nextInt();
        a = new int[501][3001];
        a[0][0] = 1;

        if (N * 6 < Q || N > Q) {
            System.out.println("0");
            return;
        }

        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < N * 6; ++j) {
                if (a[i][j] != 0) {
                    f(i, j, a[i][j]);
                }
            }
        }

        /*for (int i = 0; i < N; ++i) {
            for (int j = 0; j < Q; ++j) {
                System.out.print(a[i][j] + " ");
            }
            System.out.println();
        }

        System.out.println(a[N][Q] / Math.pow(6, N));*/
    }

    //public static void f(int i, int j, int cnt) {
    //    for (int k = 1; k < 7; k++) {
    //        //if(i+1 < N && j+k < Q)
    //        a[i + 1][j + k]+=cnt;
    //    }
    //}

    //Полный перебор перестановок из N по M с повторениями
    public static void printNM(int N, int M) {
        int element[] = new int[N];
        Arrays.fill(element, 0);
        for (int i = 1; i < N * M; ++i) {
            for (int j = 0; j < N; ++j) {
                System.out.print(element[j]);
            }
            System.out.println();
            if (!getNext(N, M, element)) {
                break;
            }
        }
    }

    public static boolean getNext(int N, int M, int mass[]) {
        //int result[] = Arrays.copyOf(mass, N);
        boolean elemIsFound = false;
        for (int i = N - 1; i >= 0; --i) {
            if (mass[i] < M - 1) {
                mass[i]++;
                return true;
            }
        }
        return false;
    }

    public static int gcd(int a, int b) {
        while (b != 0) {
            int tmp = a % b;
            a = b;
            b = tmp;
        }
        return a;
    }


    /*public static void main(String[] args) {
        int n = in.nextInt();
        int t[] = new int[n];
        int sum = 0;

        for (int i = 0; i < n; ++i) {
            t[i] = in.nextInt();
        }

        if (n < 6) {
            for (int i = 0; i < n; ++i) {
                sum += t[i];
            }
            System.out.println(sum);
            return;
        }

        int tmpSum = 0;
        for (int i = 1; i < n / 3; ++i) {
            tmpSum = 0;
            //Проверка на кратность
            if (n % (i + 1) != 0) {
                continue;
            }
            //Подсчёт сумм со смещениями
            for (int j = 0; j < i; ++j) {//смещение
                for (int k = 0; k < n / (i + 1); ++k) {//сумма с ним

                }
            }
        }


    }*/

    /*public static String ROOT = "\\";

    public static int gcd(int a, int b) {
        while (b != 0) {
            int tmp = a % b;
            a = b;
            b = tmp;
        }
        return a;
    }

    public static void main(String[] args) {

        int numCommands = in.nextInt();
        Vector<String> commands = new Vector<String>();

        for (int i = 0; i < numCommands; ++i) {
            commands.add(in.next());
        }

        for (int i = 0; i < numCommands; ++i) {
            String[] parseCommand = commands.get(i).split("/");
            for (int j = 0; j < parseCommand.length; ++j) {
                System.out.print(parseCommand[j] + "___");
            }
            System.out.println("");
        }

        String currentCD = ROOT;


    }

    public static String cd(String command, String currentPath) {
        String result = "";
        Vector<String> parseCurrent;
        if (!command.contains("..")) {
            return currentPath;
        } else {
            String[] parseCurPath = currentPath.split("/");
            String[] parseCommand = command.split("/");

            System.out.println(parseCurPath);
            System.out.println(parseCommand);
        }


        return result;
    }*/
}


/*public static int gcd(int a, int b) {
    while (b != 0) {
        int tmp = a % b;
        a = b;
        b = tmp;
    }
    return a;
}

public static void main(String[] args) {
    Vector<Integer> mass = new Vector<Integer>();
    for (int i = 0; i < 4; ++i) {
        mass.add(in.nextInt());
    }
    int d = in.nextInt();

    //boolean flags[] = new boolean[d];

    for (int i = 0; i < 4; ++i) {
        if (mass.get(i) == 1) {
            System.out.println(d);
            return;
        }
    }

    mass = normaliseMulties(mass);
    System.out.println(mass);

    int result;
    if (mass.size() == 4) {
        result = d / mass.get(0) + d / mass.get(1) + d / mass.get(2) + d / mass.get(3) -
                d / (mass.get(0) * mass.get(1)) - d / (mass.get(0) * mass.get(2)) - d / (mass.get(0) * mass.get(3)) - d / (mass.get(1) * mass.get(2)) - d / (mass.get(1) * mass.get(3)) - d / (mass.get(2) * mass.get(3)) +
                d / (mass.get(0) * mass.get(1) * mass.get(2)) + d / (mass.get(0) * mass.get(1) * mass.get(3)) + d / (mass.get(1) * mass.get(2) * mass.get(3)) - d / (mass.get(0) * mass.get(1) * mass.get(2) * mass.get(3));
    } else if (mass.size() == 3) {
        result = d / mass.get(0) + d / mass.get(1) + d / mass.get(2) -
                d / (mass.get(0) * mass.get(1)) - d / (mass.get(0) * mass.get(2)) - d / (mass.get(1) * mass.get(2)) + d / (mass.get(0) * mass.get(1) * mass.get(2));
    } else if (mass.size() == 2) {
        result = d / mass.get(0) + d / mass.get(1) - d / (mass.get(0) * mass.get(1));
    } else {
        result = d / mass.get(0);
    }

    System.out.println(result);
}

public static Vector<Integer> normaliseMulties(Vector<Integer> vector) {
    //remove duplicates
    for (int i = 0; i < vector.size(); ++i) {
        for (int j = i + 1; j < vector.size() - 1; ++j) {
            if (vector.get(i).intValue() == vector.get(j).intValue()) {
                vector.removeElement(vector.get(j));
            }
        }
    }


    for (int i = 0; i < vector.size(); ++i) {
        for (int j = i + 1; j < vector.size() - 1; ++j) {
            if (gcd(vector.get(i).intValue(), vector.get(j).intValue()) == Math.min(vector.get(i).intValue(), vector.get(j).intValue())) {
                vector.removeElement(Math.max(vector.get(i).intValue(), vector.get(j).intValue()));
            }
        }
    }
    return vector;
}*/