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

#define Gene template< class
#define Rics printer& operator,
Gene c> struct rge{c b, e;};
Gene c> rge<c> range(c i, c j){ return {i, j};}
struct printer{
    ~printer(){cerr<<endl;}
    Gene c >Rics(c x){ cerr<<boolalpha<<x; return *this;}
    Rics(string x){cerr<<x;return *this;}
    Gene c, class d >Rics(pair<c, d> x){ return *this,"(",x.first,", ",x.second,")";}
    Gene ... d, Gene ...> class c >Rics(c<d...> x){ return *this, range(begin(x), end(x));}
    Gene c >Rics(rge<c> x){
        *this,"["; for(auto it = x.b; it != x.e; ++it)
            *this,(it==x.b?"":", "),*it; return *this,"]";}
};
#define debug() cerr<<"LINE "<<__LINE__<<" >> ", printer()
#define dbg(x) "[",#x,": ",(x),"] "
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int my_rand(int l, int r) {
    return uniform_int_distribution<int>(l, r) (rng);
}


vector<int> par;

int P(int u) {
    return par[u] = (par[u] == u ? u : P(par[u]));
}

bool Merge(int u, int v) {
    u = P(u), v = P(v);
    if(u == v) return false;
    par[u] = v;
    return true;
}

bool okay(vector<int> &a, vector<int> &b) {
    int n = 0;
    for(int x : a) n += x;
    par.assign(n+1, 0);
    for(int i = 1; i <= n; i++) par[i] = i;
    int comp = n;
    int L = 1;
    for(int x : a) {
        int R = L+x-1;
        for(int i = L, j = R; i < j; i++, j--) {
            comp -= Merge(i, j);
        }
//        debug(), dbg(L), dbg(R), dbg(n);
        L = R+1;
    }

    L = 1;
    for(int x : b) {
        int R = L+x-1;
        for(int i = L, j = R; i < j; i++, j--) {
            comp -= Merge(i, j);
        }
//        debug(), dbg(L), dbg(R), dbg(n);
        L = R+1;
    }
    return comp == 1;
}


void solve() {
    int n, m;
    m = my_rand(1, 10);
    cin >> n >> m;
    int sum = 0;
    vector<int> a(m);
    for(int i = 0; i < m; ++i) {
        if(my_rand(1, 10) > 7) a[i] = my_rand(1, 10);
        else a[i] = 2 * my_rand(1, 5);
        cin >> a[i];
    }
    int odd = 0;
    for(int x : a) odd += (x & 1);

    vector<int> b;

    if(odd > 2) {
        cout << "Impossible" << endl;
        return;
    }
    if(odd == 0) {
        b = a;
        b.insert(b.begin(), +1);
        b.back()--;
    }
    else if(odd == 1) {
        for(int i = 0; i < (int)a.size(); i++) {
            if(a[i] & 1) swap(a[0], a[i]);
        }
        if(m > 1) {
            b = a;
            b[0]++;
            b.back()--;
        }
        else {
            b.push_back(1);
            if(a[0] > 1) b.push_back(a[0]-1);
        }
    }
    else {
        for(int i = 0; i < (int)a.size(); i++) {
            if(a[i] & 1) swap(a[0], a[i]);
        }
        for(int i = 1; i < (int)a.size(); i++) {
            if(a[i] & 1) swap(a[i], a.back());
        }
        b = a;
        b[0]++;
        b.back()--;
        if(b.back() == 0) b.pop_back();
    }
    assert(okay(a, b));
    for(int x : a) cout << x << " ";
    cout << endl;
    cout << b.size() << endl;
    for(int x : b) cout << x << " ";
    cout << endl;
}


int main() {
//    freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int tc = 1;
//    cin >> tc;
    while(tc--) {
        solve();
    }
}



Measured memory_bytes: 3700