// Arup Guha
// 4/12/2015
// Solution to 2012 NCPC Problem B: Bread

import java.util.*;
import java.io.*;

public class bread {

	public static int n;

	public static void main(String[] args) throws Exception {

		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(stdin.readLine().trim());

		// Store this inverted - so we can easily count inversions
		// in the real input array.
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		int[] start = new int[n];
		for (int i=0; i<n; i++)
			start[Integer.parseInt(tok.nextToken())-1] = i;

		// And this also.
		tok = new StringTokenizer(stdin.readLine());
		int[] end = new int[n];
		for (int i=0; i<n; i++)
			end[Integer.parseInt(tok.nextToken())-1] = i;

		// Count inversions.
		long sInversions = countInversions(start);
		long eInversions = countInversions(end);

		// Parity must be the same since the bread flip maintains parity of # of inversions.
		if (sInversions%2L == eInversions%2L)
			System.out.println("Possible");
		else
			System.out.println("Impossible");
	}

	public static long countInversions(int[] array) {

		// Will insert locations of items from array.
		IntervalTree tree = new IntervalTree(n);

		long res = 0L;
		for (int i=n-1; i>=0; i--) {
			res += tree.inGap(0, array[i]);
			tree.add(array[i]);
		}
		return res;
	}
}

class IntervalTree {

	private int[][] freq;
	private int levels;
	private int mappedN;

	// Allows storage of items 0..n-1.
	public IntervalTree(int n) {

		// Allocate enough space for the "tree"
		levels = myLog(n);
		freq = new int[levels][];
		int cur = 1;
		for (int i=0; i<freq.length; i++) {
			freq[i] = new int[cur];
			cur *= 2;
		}
		mappedN = cur/2;

	}

	public void add(int item) {

		int low = 0, high = mappedN;
		int curIndex = 0;
		int step = mappedN/2;

		// We always go to the bottom of the tree.
		for (int i=0; i<freq.length; i++) {

			freq[i][curIndex]++;
			int splitVal = (low + high)/2;

			if (item < splitVal) {
				curIndex *= 2;
				high = high - step;
			}
			else {
				curIndex = 2*curIndex + 1;
				low = low + step;
			}

			step /= 2;
		}

	}

	public int inGap(int low, int high) {
		if (low == 0) return query(high);
		return query(high) - query(low-1);
	}

	// Returns the numberof items <= n.
	public int query(int n) {

		int low = 0, high = mappedN;
		int curIndex = 0;
		int step = mappedN/2, sum = 0;

		// We always go to the bottom of the tree.
		for (int i=0; i<freq.length; i++) {

			int splitVal = (low+high)/2;

			if (n == high-1) {
				sum += freq[i][curIndex];
				break;
			}
			if (n < splitVal) {
				curIndex *= 2;
				high = high - step;
			}
			else {
				if (i < freq.length-1) sum += freq[i+1][2*curIndex];
				curIndex = 2*curIndex + 1;
				low = low + step;
			}

			step /= 2;
		}
		return sum;
	}

	private static int myLog(int n) {

		int i = 1, powtwo = 1;
		while (powtwo < n) {
			i++;
			powtwo *= 2;
		}
		return i;
	}
}