#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define REP(NAME, NUM) for (int NAME = 0; NAME < int(NUM); ++NAME)
#define BREP(NAME, NUM) for (int NAME = (NUM)-1; NAME >= 0; --NAME)
#define ALL(NAME) (NAME).begin(), (NAME).end()

#define cMOD 1000000007ULL
#define cINF ((1ll<<62)-1)
#define cINFINT ((1<<30)-1)

template <typename T>
void chmin(T& a, T b){ if(a > b) a = b; }
template <typename T>
void chmax(T& a, T b){ if(a < b) a = b; }


int main()
{
    cin.tie( 0 ); ios::sync_with_stdio( false );
    // ----------------------------------------------------------------
    
    ull n = 0;
    string s;
    cin >> n >> s;
    ++n;

    vector<ll> vec( n, 0 );
    REP(i, n) cin >> vec[i];

    ll k = 100000;
    REP(i, n-1) chmin(k, abs(vec[i+1] - vec[i]));
    
    cout << k << endl;
    REP(kk, k) REP(i, n)
    {
        cout << (vec[i]+kk)/k << ((i==n-1)?"\n":" ");
    }
    
    // ----------------------------------------------------------------
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, A[N], k = INT_MAX;
int main()
{
    scanf("%d%*s", &n);
    for(int i = 0; i <= n; ++i)
        scanf("%d", &A[i]), k = min(k, i ? abs(A[i] - A[i - 1]) : k);
    printf("%d\n", k);
    for(int i = 1; i <= k; ++i)
        for(int j = 0; j <= n; ++j)
            printf("%d%c", A[j] / k + (A[j] % k >= i), " \n"[j == n]);
    return 0;
}