// Arup Guha
// 4/18/2023
// Solution to 2012 NCPC Problem: Bread Sorting
// https://open.kattis.com/problems/bread

using namespace std;
#include <bits/stdc++.h>
typedef long long ll;

class bit {
    public:
        bit(int n);
        ll sum(int idx);
        ll sum(int low, int high);
        void add(int idx, ll val);
    private:
        int sz;
        vector<ll> freq;
};

// Constructor.
bit::bit(int n) {

    // Make next power of two.
    sz = 1;
    while (sz <= n) sz <<= 1;

    // Initialize to all 0s.
    for (int i=0; i<sz; i++) freq.push_back(0);
}

// Returns sum of items in indexes 1 through idx.
ll bit::sum(int idx) {

    ll res = 0;

    // We "count down" in indexes.
    while (idx) {

        // Add in this indexes contribution.
        res += freq[idx];

        // Here is the next place we have to go that hasn't been added yet.
        idx -= (idx&(-idx));
    }
    return res;
}

// Returns sum of values stored in indexes low through high, inclusive.
ll bit::sum(int low, int high) {
    return sum(high) - sum(low-1);
}

// Adds val to index idx.
void bit::add(int idx, ll val) {

    // Here we go "up"
    while (idx < sz) {

        // This index is keeping track of this value so add it.
        freq[idx] += val;

        // This is the next index that is storing the value as well.
        idx += (idx&(-idx));
    }
}

int main() {

    int n, tmp;
    cin >> n;

    // For each value, we store which 1-based index it's located in.
    map<int,int> vals;
    for (int i=0; i<n; i++) {
        cin >> tmp;
        vals[tmp] = i+1;
    }

    // We replace each item in the second array with its index in the
    // first array.
    vector<int> alt;
    for (int i=0; i<n; i++) {
        cin >> tmp;
        alt.push_back(vals[tmp]);
    }

    bit mybit(n+5);
    ll res = 0;

    // Now we will count all inversions.
    for (int i=0; i<n; i++) {

        // Everything before me that's bigger than me.
        res += mybit.sum(alt[i]+1,n+1);

        // Add one to my index so I am counted in future queries.
        mybit.add(alt[i], 1);
    }

    // The bread sort operation changes the # of inversions by 2,0 or -2
    // so it's only possible if the # of inversions is even.
    if (res%2 == 0)
        cout << "Possible" << endl;
    else
        cout << "Impossible" << endl;

    return 0;
}
