#include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); i++)
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define fill(x,y) memset(x,y,sizeof(x))
#define prev PREV
#define next NEXT
                         
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }
template<class T> inline T sqr (T x) { re x * x; }

#define filename ""

const int LEN = 20;
const int TT = 20;

int n;
int m;
int p[100100];
int a[100];
int b[100];
vi w[2];

int gp (int x) {
	if (p[x] != x) p[x] = gp (p[x]);
	re p[x];
}

int merge (int a, int b) {
	a = gp (a);
	b = gp (b);
	if (a != b) {
		p[a] = b;
		re 1;
	}
	re 0;
}

int good (int m1, int m2) {
/*	for (int i = 0; i < m1; i++) printf ("%d ", a[i]);
	printf ("\n");
	for (int i = 0; i < m2; i++) printf ("%d ", b[i]);
	printf ("\n");*/
	for (int i = 0; i < n; i++) p[i] = i;
	int pos = 0, now = n;
	for (int i = 0; i < m1; i++) {
		for (int j = 0, k = a[i] - 1; j < k; j++, k--)
			now -= merge (pos + j, pos + k);		
		pos += a[i];
	}
	pos = 0;
	for (int i = 0; i < m2; i++) {
		for (int j = 0, k = b[i] - 1; j < k; j++, k--)
			now -= merge (pos + j, pos + k);		
		pos += b[i];
	}
//	for (int i = 0; i < n; i++) printf ("%d ", gp (i));
//	printf ("\n");
//	printf ("%d\n", now);
	re int (now == 1);
}

int main () {
	scanf ("%d%d", &n, &m);
	int odd = 0;
	for (int i = 0; i < m; i++) {
		scanf ("%d", &a[i]);
		odd += a[i] & 1;
		w[a[i] & 1].pb (a[i]);
	}
	if (m == 1) {
		if (n == 1) {
			printf ("1\n1\n1\n");
		} else {
			printf ("%d\n2\n1 %d\n", a[0], n - 1);
		}
		re 0;
	} else
	if (!odd) {
		while (true) {
			random_shuffle (a, a + m);
			for (int i = 0; i < m; i++) b[i] = a[i];
			b[0]++;
			b[m - 1]--;
			if (good (m, m)) {
				for (int i = 0; i < m; i++) printf ("%d ", a[i]);
				printf ("\n");
				printf ("%d\n", m);
				for (int i = 0; i < m; i++) printf ("%d ", b[i]);
				printf ("\n");
				re 0;
			}
		}
	} else
	if (odd == 1) {
		sort (all (w[1]));
		while (true) {
			a[0] = w[1][0];
			for (int i = 0; i < m - 1; i++) a[i + 1] = w[0][i];
			random_shuffle (a + 1, a + m);
			for (int i = 0; i < m; i++) b[i] = a[i];
			b[0]++;
			b[m - 1]--;
			if (good (m, m)) {
				for (int i = 0; i < m; i++) printf ("%d ", a[i]);
				printf ("\n");
				printf ("%d\n", m);
				for (int i = 0; i < m; i++) printf ("%d ", b[i]);
				printf ("\n");
				re 0;
			}
		}	
	} else
	if (odd == 2) {
		while (true) {
			a[0] = w[1][0];
			for (int i = 0; i < m - 2; i++) a[i + 1] = w[0][i];
			a[m - 1] = w[1][1];
			random_shuffle (a + 1, a + m - 1);
			for (int i = 0; i < m; i++) b[i] = a[i];
			int mm = m;
			if (b[m - 1] == 1) {
				for (int i = 0; i < m - 1; i++) b[i] = b[i + 1];
				b[m - 2] = 2;
				mm--;
			} else {
				b[0]++;
				b[m - 1]--;
			}
			if (good (m, mm)) {
				for (int i = 0; i < m; i++) printf ("%d ", a[i]);
				printf ("\n");
				printf ("%d\n", mm);
				for (int i = 0; i < mm; i++) printf ("%d ", b[i]);
				printf ("\n");
				re 0;
			}
		}	
	}
	printf ("Impossible\n");	
	return 0;
}

Measured memory_bytes: 640