#include <bits/stdc++.h>
using std::lower_bound;
using std::make_pair;
using std::pair;
using std::sort;
using std::vector;
const int N = 1e6 + 5;
int n, m, sum;
int a[N], b[N];
int d[N], f[N];
int tot;
vector<pair<int, int> > V[N];
signed main() {
  int x, ptr;
  register int i, j, k;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++)
    scanf("%d", &x), sum += x, a[i] += x / n, b[i] += x % n;
  ptr = 1;
  while (ptr <= m) {
    while (ptr <= m && b[ptr] == 0) ptr++;
    if (ptr > m) break;
    tot++;
    for (i = ptr - 1, x = 0; i < m && x + b[i + 1] <= n; i++, x += b[i])
      V[tot].push_back(make_pair(x + b[i + 1], i + 1)), d[i + 1] = x + b[i + 1];
    if (i != m && n - x != 0) V[tot].push_back(make_pair(n, i + 1));
    if (i == m) break;
    b[i + 1] -= n - x;
    ptr = i + 1;
  }
  d[m] = n;
  sort(d + 1, d + m + 1);
  for (i = 1; i <= m; i++) f[i] = d[i] - d[i - 1];
  printf("%d\n", (sum + n - 1) / n);
  for (i = 1; i <= m; i++) printf("%d ", f[i]);
  putchar('\n');
  for (i = 1; i <= n; i++)
    for (j = 1; j <= a[i]; j++) {
      for (k = 1; k <= m; k++) printf("%d ", i);
      putchar('\n');
    }
  for (i = 1; i <= tot; i++) {
    x = 0;
    for (j = 0; j < (int)V[i].size(); j++) {
      ptr = lower_bound(d + 1, d + m + 1, V[i][j].first) - d;
      for (k = x + 1; k <= ptr; k++) printf("%d ", V[i][j].second);
      x = ptr;
    }
    for (k = x + 1; k <= m; k++) printf("1 ");
    putchar('\n');
  }
  return 0;
}

### Prompt

Your challenge is to write a Cpp solution to the following problem:

Recently Evlampy installed one interesting computer game, one of aspects of which is to split army into several groups and then fight with enemy's groups. Let us consider a simplified version of the battle.

In the nearest battle Evlampy should fight an enemy army that consists of m groups, the i-th of which has hp_i health points.

Evlampy's army consists of n equal soldiers. Before each battle he should split his army in exactly m groups (possibly, empty) so that the total size of the groups is n. The battle is played step-by-step. On each step each of Evlampy's groups attacks exactly one enemy group. Thus, each step is described with an array of m integers a_1, a_2, …, a_m, meaning that the i-th Evlampy's group attacks the a_i-th enemy group. Different groups can attack same group, on each step the array a is chosen independently.

After each step the health points of each enemy group decreases by the total number of soldiers in Evlampy's groups that attacked this enemy group at this step. Enemy group is destroyed once its health points are zero or negative. Evlampy's soldiers do not lose health.

<image> An example of a step. The numbers in green circles represent the number of soldiers in Evlampy's groups, the arrows represent attacks, the numbers in red circles represent health points of enemy groups, the blue numbers represent how much the health points will decrease after the step.

Evlampy understands that the upcoming battle will take the whole night. He became sad because this way he won't have enough time to finish his homework. Now Evlampy wants you to write a program that will help him win in the smallest possible number of steps. Can you help him?

In other words, find the smallest number of steps needed to destroy all enemy groups and show a possible way of doing this. Find the requires splitting of the army into m groups and the arrays a for each step.

Input

The first line contains two integers n and m (1 ≤ m ≤ n ≤ 10^{6}) — the number of soldiers in Evlampy's army and the number of groups in enemy army. m is also equal to the maximum possible number of groups Evlampy can split the army to.

The second line contains m integers hp_1, hp_2, …, hp_m (1 ≤ hp_i ≤ 10^{6}) — the health points of each of the enemy groups.

It is guaranteed that the sum of hp_i does not exceed 10^{6}.

Output

Print a single integer t — the minimum possible number of steps needed to win the battle.

After that print m integers s_1, s_2, …, s_m (s_i ≥ 0, s_1 + s_2 + … + s_m = n), meaning that the i-th group of Evlampy's army should contain s_i soldiers.

In each of the next t lines print m integers a_1, a_2, …, a_m (1 ≤ a_i ≤ m) — the description of one step. The integers mean that on the corresponding step the i-th Evlampy's group should attack the a_i-th enemy group. It is allowed to attack an already destroyed group.

Examples

Input


13 7
6 4 3 7 2 1 5


Output


3
0 1 2 3 1 2 4
2 6 2 4 4 2 4
3 1 7 1 7 7 1
3 1 5 3 7 5 1


Input


6 5
3 3 3 3 3


Output


3
3 3 0 0 0
1 2 3 4 5
3 4 5 5 5
5 5 5 5 5


Input


7 4
1 5 9 2


Output


3
1 2 4 0
1 4 2 3
2 3 3 3
3 3 3 3

Note

The first example is shown below.

<image>

### Response

```cpp
#include <bits/stdc++.h>
using std::lower_bound;
using std::make_pair;
using std::pair;
using std::sort;
using std::vector;
const int N = 1e6 + 5;
int n, m, sum;
int a[N], b[N];
int d[N], f[N];
int tot;
vector<pair<int, int> > V[N];
signed main() {
  int x, ptr;
  register int i, j, k;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++)
    scanf("%d", &x), sum += x, a[i] += x / n, b[i] += x % n;
  ptr = 1;
  while (ptr <= m) {
    while (ptr <= m && b[ptr] == 0) ptr++;
    if (ptr > m) break;
    tot++;
    for (i = ptr - 1, x = 0; i < m && x + b[i + 1] <= n; i++, x += b[i])
      V[tot].push_back(make_pair(x + b[i + 1], i + 1)), d[i + 1] = x + b[i + 1];
    if (i != m && n - x != 0) V[tot].push_back(make_pair(n, i + 1));
    if (i == m) break;
    b[i + 1] -= n - x;
    ptr = i + 1;
  }
  d[m] = n;
  sort(d + 1, d + m + 1);
  for (i = 1; i <= m; i++) f[i] = d[i] - d[i - 1];
  printf("%d\n", (sum + n - 1) / n);
  for (i = 1; i <= m; i++) printf("%d ", f[i]);
  putchar('\n');
  for (i = 1; i <= n; i++)
    for (j = 1; j <= a[i]; j++) {
      for (k = 1; k <= m; k++) printf("%d ", i);
      putchar('\n');
    }
  for (i = 1; i <= tot; i++) {
    x = 0;
    for (j = 0; j < (int)V[i].size(); j++) {
      ptr = lower_bound(d + 1, d + m + 1, V[i][j].first) - d;
      for (k = x + 1; k <= ptr; k++) printf("%d ", V[i][j].second);
      x = ptr;
    }
    for (k = x + 1; k <= m; k++) printf("1 ");
    putchar('\n');
  }
  return 0;
}

```