#include<iostream>
#include<iomanip>
#include<bitset>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#include<queue>
#include<map>
#include<set>
using namespace std;
using ll=long long;

int main(){
    int N;
    string S;
    cin >> N >> S;
    N++;
    vector<int> A(N);
    for(int &x: A)cin >> x;
    int dmi = 1000000;
    for(int i = 1; i < N; i++){
        int d = abs(A[i] - A[i - 1]);
        dmi = min (dmi, d);
    }
    cout << dmi << endl;
    for(int i = 0; i < dmi; i++){
        vector<int> B(N, 0);
        for(int j = 0; j < N; j++){
            B[j] = A[j] / dmi;
            if(dmi - i <= A[j] % dmi)B[j]++;
        }
        for(int j = 0; j < N; j++){
            if(j < N - 1){
                cout << B[j] << " ";
                continue;
            }
            cout << B[j] << endl;
        }
    }
    return 0;
}
/*
 * author :Sadik Hassan(_sad_)
 *
*/
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include "bits/stdc++.h"
using namespace std;
using   ll =          long long;
using   ld =          long double;
#define nl            "\n"
#define pb            push_back
#define fi            first
#define se            second
#define MP            make_pair
#define PI            (acos(-1.0))
#define rep1(i,n)     for(int i=1;i<=n;i++)
#define rep(i,n)      for(int i=0;i<n;i++)
#define urep(i,n)     for(int i=n-1;i>=0;i--)
#define urep1(i,n)    for(int i=n;i>=1;i--)
#define SZ(s)         (int)s.size()
#define all(x)        (x).begin(), (x).end()
#define rall(x)       (x).rbegin(), (x).rend()
#define w(t)          int t;cin>>t;while(t--)
#define _SAD()     	  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0),cout<<fixed<<setprecision(2);

typedef vector<int> vi;
typedef vector<ll> vii;
typedef set<int> si;
typedef set<ll> sii;
/*---------------------------------------------------------------------*/

const int N = (int)1e6;
const int MOD =(int)1e9+7;
const ll INF = (ll)1e18+5;


int main()
{
    _SAD()
    int n,l;cin>>n>>l;
    cout<<n/l<<nl;
    return 0;
}
