#pragma comment(linker, "/STACK:60000000")
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <ctime>
#include <cstring>
#include <cassert>
#include <sstream>
#include <iomanip>
#include <complex>
#include <queue>
#include <functional>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define last(a) int(a.size() - 1)
#define all(a) a.begin(), a.end()
#define seta(a,x) memset (a, x, sizeof (a))
#define I (int)
#define y1 botva

typedef long long int64;
typedef pair <int, int> pii;
typedef long double ldb;

const long double eps = 1e-7;
const int inf = (1 << 30) - 1;
const int64 inf64 = ((int64)1 << 62) - 1;
const long double pi = 3.1415926535897932384626433832795;
const string task = "juggling";

template <class T> T sqr (T x) {return x * x;}

const int pmax = 400;
const int nmax = 200;

int n, need;
int a[2][nmax], res[2][nmax];
int cnt[nmax], st[nmax];

void no(){
	puts("Impossible");
	exit(0);
}

void pre_calc(){
	forn(i, 2){
		int now = 400;
		forn(j,st[i]){
			res[i][a[i][j]] = now;
			now --;
		}
		now = n - st[i];
		for (int j = st[i]; j < n; j++){
			res[i][a[i][j]] = now;
			now --;
		}
	}
}

bool add(int day){
	if (res[day][a[day][st[day]]] == 400) return 0;
	if (st[day] > 0 && res[day][a[day][st[day]]] == res[day][a[day][st[day]-1]] - 1) return 0;	
	for (int i = st[day]; i < n; i++){
		res[day][a[day][i]] ++;
		if (a[day][i] == 0) break;
	}
	return 1;
}

int get(){
	int cnt = 0;
	forn(i,n)
		if (res[0][i] + res[1][i] > res[0][0] + res[1][0])
			cnt ++;
	return cnt;
}

bool check(){
	forn(i,2){
		forn(j,n){
			if (j < n-1 && res[i][a[i][j]] <= res[i][a[i][j+1]]) return 0;
			if (res[i][a[i][j]] < 0 || res[i][a[i][j]] > 400) return 0;
		}
	}
	return 1;
}

void solve(){
	forn(i, 2)
		forn(j, n)
			a[i][j] --;
	need --;
	seta(cnt, 0);
	forn(j,2){
		forn(i,n){
			if (a[j][i] == 0) break;
			cnt[a[j][i]] ++;
		}
	}
	int up = 0, mid;
	forn(i, n){
		if (cnt[i] == 2) up ++;
		if (cnt[i] == 1) mid ++;
	}
	if (up > need) no();
	if (up + mid < need) no();
	for (st[0] = 0; st[0] <= n; st[0]++)
	for (st[1] = 0; st[1] <= n; st[1]++){
		pre_calc();
		{
			int w = get();
			while (w > need && st[0] < n && add(0)) w = get();
			while (w > need && st[1] < n && add(1)) w = get();
			if (w == need) return;
		}
		pre_calc();
		{
			int w = get();
			while (w > need && st[1] < n && add(1)) w = get();
			while (w > need && st[0] < n && add(0)) w = get();
			if (w == need) return;
		}
	}
	no();		
}

void read(){
	scanf("%d %d", &n, &need);
	forn(j,2)
		forn(i,n)
			scanf("%d", &a[j][i]);
}

void write(){
	puts("Possible");
	forn(i,2){
		sort(res[i], res[i] + n);
		ford(j, n)
			printf("%d ", res[i][j]);
		printf("\n");
	}
}

int main ()
{
	freopen ((task + ".in").data(), "r", stdin);
	freopen ((task + ".out").data(), "w", stdout);

	read();
	solve();
	write();

	return 0;
}