// Arup Guha
// 4/12/2015
// Alternate Solution to 2012 NCPC Problem B: Bread
// Uses my new interval tree that is actually a tree.

import java.util.*;
import java.io.*;

public class bread2 {

	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.
		IntTree tree = new IntTree(0, n-1);

		long res = 0L;
		for (int i=n-1; i>=0; i--) {
			res += tree.query(0, array[i]);
			tree.change(array[i], array[i], 1);
		}
		return res;
	}
}

class IntTree {

	// Stores range for this node.
	public int low;
	public int high;

	// Stores aggregate data for this node.
	public int delta;
	public int value;

	// Pointers to children.
	public IntTree left;
	public IntTree right;

	// Creates an interval tree from myLow to myHigh, inclusive.
	public IntTree(int myLow, int myHigh) {

		low = myLow;
		high = myHigh;
		delta = 0;
		value = 0; /*** Can change ***/

		// Lowest level.
		if (low == high) {
			left = null;
			right = null;
		}

		// Must create more nodes.
		else {
			int mid = (low+high)/2;
			left = new IntTree(low, mid);
			right = new IntTree(mid+1, high);
		}
	}

	// Propogates a change down to child nodes.
	public void prop() {

		// Recursive case, push down.
		if (left != null) {
			left.delta += delta;	/*** can change ***/
			right.delta += delta;	/*** can change ***/
			delta = 0;
		}

		// I put this in, seems to make sense.
		else {
			value += delta; /*** Can change - set for sum now ***/
			delta = 0;
		}
	}

	// Pre-condition: delta is 0.
	public void update() {
		if (left != null)
			value = left.value+left.delta*(left.high-left.low+1)+right.value+right.delta*(right.high-right.low+1); /*** Can change ***/
	}

	// Changes the values in the range [start, end] by "adding" extra.
	public void change(int start, int end, int extra) {

		// Out of range.
		if (high < start || end < low) return;

		// Push down delta.
		prop();

		// Whole range must be updated.
		if (start <= low && high <= end) {
			delta += extra;		/*** Can change ***/
			update();
			return;
		}

		// Portions of children have to be changed instead.
		left.change(start, end, extra);
		right.change(start, end, extra);
		update();
	}

	public int query(int start, int end) {

		// Out of range.
		if (high < start || end < low) return  0; /*** Can change ***/

		// Whole range must be returned;
		if (start <= low && high <= end) {
			return value + delta*(high-low+1);
		}

		// Get answers from both potions.
		prop();
		int leftSide = left.query(start, end);
		int rightSide = right.query(start, end);
		update();
		return leftSide+rightSide;
	}
}
