Problem: One day Ms Swan bought an orange in a shop. The orange consisted of n·k segments, numbered with integers from 1 to n·k. 

There were k children waiting for Ms Swan at home. The children have recently learned about the orange and they decided to divide it between them. For that each child took a piece of paper and wrote the number of the segment that he would like to get: the i-th (1 ≤ i ≤ k) child wrote the number ai (1 ≤ ai ≤ n·k). All numbers ai accidentally turned out to be different.

Now the children wonder, how to divide the orange so as to meet these conditions:

  * each child gets exactly n orange segments; 
  * the i-th child gets the segment with number ai for sure; 
  * no segment goes to two children simultaneously. 



Help the children, divide the orange and fulfill the requirements, described above.

Input

The first line contains two integers n, k (1 ≤ n, k ≤ 30). The second line contains k space-separated integers a1, a2, ..., ak (1 ≤ ai ≤ n·k), where ai is the number of the orange segment that the i-th child would like to get.

It is guaranteed that all numbers ai are distinct.

Output

Print exactly n·k distinct integers. The first n integers represent the indexes of the segments the first child will get, the second n integers represent the indexes of the segments the second child will get, and so on. Separate the printed numbers with whitespaces.

You can print a child's segment indexes in any order. It is guaranteed that the answer always exists. If there are multiple correct answers, print any of them.

Examples

Input

2 2
4 1


Output

2 4 
1 3 


Input

3 1
2


Output

3 2 1 

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.StringTokenizer;
 
public class Main{
 
    static class InputReader {
 
        final private int BUFFER_SIZE = 1 << 17;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;
 
        public InputReader(InputStream in) {
            din = new DataInputStream(in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public byte next() {
            try {
                return read();
            } catch (Exception e) {
                throw new InputMismatchException();
            }
        }
 
        public String nextString() {
            StringBuilder sb = new StringBuilder("");
            byte c = next();
            while (c <= ' ') {
                c = next();
            }
            do {
                sb.append((char) c);
                c = next();
            } while (c > ' ');
            return sb.toString();
        }
 
        public int nextInt() {
            int ret = 0;
            byte c = next();
            while (c <= ' ') {
                c = next();
            }
            boolean neg = c == '-';
            if (neg) {
                c = next();
            }
            do {
                ret = (ret << 3) + (ret << 1) + c - '0';
                c = next();
            } while (c > ' ');
            if (neg) {
                return -ret;
            }
            return ret;
        }
 
        private void fillBuffer() {
            try {
                bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (bytesRead == -1) {
                buffer[0] = -1;
            }
        }
 
        private byte read() {
            if (bufferPointer == bytesRead) {
                fillBuffer();
            }
            return buffer[bufferPointer++];
        }
    }
   
    public static void main(String arg[]) throws IOException {
   
        InputReader r=new InputReader(System.in);
      //  BufferedReader r=new BufferedReader(new FileReader("testcase.txt"));
       // BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
    
    int n=r.nextInt();
    int k=r.nextInt();
    int a[]=new int[(n*k)+1];
    int b[]=new int[k+1];
    for(int i=1;i<=k;i++)
    {
        int x=r.nextInt();
        a[x]=1;
        b[i]=x;
    }
    int count=1;
    for(int i=1;i<=k;i++)
    {
        System.out.print(b[i]+" ");
        int c=0;
        while(c<n-1)
        {
        if(a[count]==0)
        {
            System.out.print(count+" ");
            c++;
        }
        count++;
        }
        System.out.println();
    }
    
    }}