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 
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Iterator;

/**
 * @author Roman Dzhadan
 * @E-Mail dflash36@gmail.com
 * @Skype ronex36
 */

public class Main {

	public static IO type = IO.STANDART;

	public static int MEMORY_LIMIT = 256;
	public static int TIME_LIMIT = 2;

	public static String inputFileName = "input.txt";
	public static String outputFileName = "output.txt";

	public static InputReader in;
	public static OutputWriter out;

	public static void main(String[] args) throws IOException {
		configure();
		Task task = new Task();
		task.solve(in, out);
		out.close();
	}

	private static void configure() {
		if (type == IO.FILE) {
			try {
				InputStream fileIn = new FileInputStream(
						new File(inputFileName));
				OutputStream fileOut = new FileOutputStream(new File(
						outputFileName));
				in = new InputReader(fileIn);
				out = new OutputWriter(fileOut);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		if (type == IO.STANDART) {
			try {
				InputStream stdIn = System.in;
				OutputStream stdOut = System.out;
				in = new InputReader(stdIn);
				out = new OutputWriter(stdOut);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}

/* Your solution starts here: */
class Task {
	public void solve(InputReader in, OutputWriter out) {
		
		int n = in.readInt();
		int k = in.readInt();
		int[]tab = new int[n * k];

		ArrayList[]ans = new ArrayList[k];
		for (int i = 0; i < k; i++) {
			ans[i] = new ArrayList<Integer>();
		}
		
		HashSet<Integer>set = new HashSet<Integer>();
		for (int i = 1; i <= n*k; i++) {
			set.add(i);
		}
		
		for (int i = 0; i < k; i++) {
			int val = in.readInt();
			set.remove(val);
			ans[i].add(val);
		}
		
		Iterator<Integer> it = set.iterator();
		for (int i = 0; i < k; i++) {
			while (ans[i].size() != n) {
				ans[i].add(it.next());
			}
		}
		
		for (int i = 0; i < ans.length; i++) {
			for (int j = 0; j < ans[i].size(); j++) {
				System.out.print(ans[i].get(j) + " ");
			}System.out.println();
		}
	}
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long readLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuffer res = new StringBuffer();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}

	public static boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(outputStream);
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	public void print(Object... objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(Object... objects) {
		print(objects);
		writer.println();
	}

	public void close() {
		writer.close();
	}
}

class Utils {

	public static long MOD = 1000 * 1000 * 1000 + 9;

	public static boolean[] getEratosfenSieve(int size) {
		boolean[] prime = new boolean[size + 1];
		Arrays.fill(prime, true);
		prime[0] = prime[1] = false;
		for (int i = 2; i <= size; ++i)
			if (prime[i])
				if (i * 1L * i <= size * 1L)
					for (int j = i * i; j <= size; j += i)
						prime[j] = false;
		return prime;
	}

	public static int getCodeGray(int n) {
		return n ^ (n >> 1);
	}

	public static int gcd(int a, int b) {
		if (b == 0)
			return a;
		else
			return gcd(b, a % b);
	}

	public static int lcm(int a, int b) {
		return a / gcd(a, b) * b;
	}

	public static long binPower(long base, long exponent, long mod) {
		if (exponent == 0)
			return 1;
		long result = binPower(base, exponent >> 1, mod);
		result = result * result % mod;
		if ((exponent & 1) != 0)
			result = result * base % mod;
		return result;
	}
}

enum IO {
	FILE, STANDART
}