#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	vector<int> a(m), b;
	vector<int> odds;
	for (int i = 0; i < m; ++i) {
		scanf("%d", &a[i]);
		if (a[i] & 1) odds.push_back(i);
	}
	if (odds.size() > 2) printf("Impossible\n");
	else {
		sort(odds.begin(), odds.end());
		if (odds.size() == 1) {
			swap(a[odds[0]], a[0]);
			b = a;
			--b[0];
			b.push_back(1);
		} else if (odds.size() == 2) {
			swap(a[odds[0]], a[0]);
			swap(a[odds[1]], a[m - 1]);
			b = a;
			--b[0];
			++b[m - 1];
		} else {
			b = a;
			--b[0];
			b.push_back(1);
		}
		for (int x : a) printf("%d ", x);
		printf("\n");
		if (b[0] == 0) b.erase(b.begin());
		printf("%d\n", b.size());
		for (int x : b) printf("%d ", x);
		printf("\n");
	}
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(a) (long long)((a).size())

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
    ll mod = 1e9+7;
    ll n,i,j,m;
    cin>>n>>m;
    vector<ll> x(n), y(m);
    for(i=0;i<n;i++) cin>>x[i];
    for(i=0;i<m;i++) cin>>y[i];
    ll xs = 0, ys = 0;
    for(i=0;i<n;i++)
    {
       xs = (xs + (i*x[i] - (n-i-1)*x[i]))%mod; 
    }
    for(i=0;i<m;i++)
    {
        ys = (ys + (i*y[i] - (m-i-1)*y[i]))%mod; 
    }
    ll ans = (xs*ys)%mod;
    cout<<ans;
}
