#include <stdio.h>
const int PMAX=400;
const int N=200;
int n, res[N][2], st[2], en[2], num[N][2];
int get()
{
    int r=0;
    for(int i=0; i<n; ++i)
        if(res[i][0]+res[i][1]>res[0][0]+res[0][1]) r++;
    return r;
}
int main()
{
    freopen("juggling.in", "r", stdin);
    freopen("juggling.out", "w", stdout);
    int p, x;
    scanf("%d %d", &n, &p);
    p--;
    for(int j=0; j<2; ++j)
    {
        int pts=PMAX;
        for(int i=0; i<n; ++i)
        {
            scanf("%d", &x); x--;
            res[x][j]=pts, num[i][j]=x;
            if(x==0)
            {
                st[j]=n-i; en[j]=pts;
                pts=n-i;
            }
            pts--;
        }
    }
    for(res[0][0]=st[0]; res[0][0]<=en[0]; ++res[0][0])
        for(res[0][1]=st[1]; res[0][1]<=en[1]; ++res[0][1])
            if(get()==p)
            {
                printf("Possible\n");
                for(int t=0; t<2; ++t)
                {
                    for(int k=0; k<n; ++k)
                        printf("%d ", res[num[k][t]][t]);
                    printf("\n");
                }
                return 0;
            }
    printf("Impossible");
    return 0;
}
