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

const int MaxM = 110;
int N, M, A[ MaxM ], Sum, Num;

int main() {
	scanf( "%d%d", &N, &M );
	for( int i = 1; i <= M; ++i ) scanf( "%d", &A[ i ] );
	for( int i = 1; i <= M; ++i ) Sum += A[ i ];
	if( Sum != N ) {
		printf( "Impossible" );
		return 0;
	}
	for( int i = 1; i <= M; ++i )
		if( A[ i ] % 2 == 1 ) 
			++Num;
	if( Num > 2 ) {
		printf( "Impossible" );
		return 0;
	}
	if( Num == 0 ) {
		for( int i = 1; i <= M; ++i ) printf( "%d ", A[ i ] ); printf( "\n" );
		printf( "%d\n", M + 1 );
		printf( "%d ", A[ 1 ] - 1 );
		for( int i = 2; i <= M; ++i ) printf( "%d ", A[ i ] ); 
		printf( "%d\n", 1 );
		return 0;
	}
	if( Num == 2 ) {
		int a, b;
		for( int i = 1; i <= M; ++i )
			if( A[ i ] % 2 == 1 ) {
				a = A[ i ];
				break;
			}
		for( int i = M; i >= 1; --i ) 
			if( A[ i ] % 2 == 1 ) {
				b = A[ i ];
				break;
			}
		printf( "%d ", a );
		for( int i = 1; i <= M; ++i ) 
			if( A[ i ] % 2 == 0 ) 
				printf( "%d ", A[ i ] );
		printf( "%d\n", b );
		if( a > 1 ) {
			printf( "%d\n", M );
			printf( "%d ", a - 1 );
			for( int i = 1; i <= M; ++i )
				if( A[ i ] % 2 == 0 ) 
					printf( "%d ", A[ i ] );
			printf( "%d\n", b + 1 );
			return 0;
		}
		printf( "%d\n", M - 1 );
		for( int i = 1; i <= M; ++i ) 
			if( A[ i ] % 2 == 0 ) 
				printf( "%d ", A[ i ] );
		printf( "%d\n", b + 1 );
		return 0;
	}
	int t = 0;
	for( int i = 1; i <= M; ++i ) 
		if( A[ i ] % 2 == 1 ) {
			t = A[ i ];
			break;
		}
	printf( "%d ", t );
	for( int i = 1; i <= M; ++i ) 
		if( A[ i ] % 2 == 0 ) 
			printf( "%d ", A[ i ] );
	printf( "\n" );
	if( t > 1 ) {
		printf( "%d\n", M + 1 );
		printf( "%d ", t - 1 );
		for( int i = 1; i <= M; ++i ) 
			if( A[ i ] % 2 == 0 )
				printf( "%d ", A[ i ] );
		printf( "%d\n", 1 );
	} else {
		printf( "%d\n", M );
		for( int i = 1; i <= M; ++i ) 
			if( A[ i ] % 2 == 0 ) 
				printf( "%d ", A[ i ] );
		printf( "%d\n", 1 );
	}
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef pair<l_l,ll> lll;
typedef vector<string> vs;
const ll dx[4]={1,-1,0,0};
const ll dy[4]={0,0,1,-1};
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int main(){
    ll n,k;cin>>n>>k;
    vl a(n);
    rep(i,n)cin>>a[i];
    rep(t,k){
        vl imos(n+1);
        rep(i,n){
            imos[max(i-a[i],0ll)]++;
            imos[min(i+a[i]+1,n)]--;
        }
        rep(i,n)imos[i+1]+=imos[i];
        imos.pop_back();
        if(imos==a)break;
        a=imos;
    }
    rep(i,n)cout<<a[i]<<" ";cout<<endl;
}