// Arup Guha
// 9/17/2026
// Solution to Kattis Problem: Bread Sorting
// https://open.kattis.com/problems/bread
// Shown to illustrate the use of a binary index tree.

import java.util.*;
import java.io.*;

public class bread {
	
	public static void main(String[] args) throws Exception {
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(stdin.readLine());
			
		// Read first array.
		int[] a1 = new int[n];
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		for (int i=0; i<n; i++)
			a1[i] = Integer.parseInt(tok.nextToken());
		
		// Read second array.
		int[] a2 = new int[n];
		tok = new StringTokenizer(stdin.readLine());
		for (int i=0; i<n; i++)
			a2[i] = Integer.parseInt(tok.nextToken());	
		
		// Get # of inversions in both.
		long sum1 = numInversions(a1);
		long sum2 = numInversions(a2);
		
		// Ta da!
		if (sum1%2 == sum2%2)
			System.out.println("Possible");
		else
			System.out.println("Impossible");
	}
	
	// Returns the number of inversions in arr.
	public static long numInversions(int[] arr) {
		
		bit mybit = new bit(arr.length);
		long res = 0;
		
		// Go left to right in original array.
		for (int i=0; i<arr.length; i++) {
			
			// Adds inversions with item at index i with items to its left.
			res = res + mybit.sumAbove(arr[i]);
			
			// Update this so we know that one more value "to the left" equals arr[i].
			mybit.add(arr[i], 1);
		}
		
		return res;
	}
}

class bit {

	private int n;
	private int[] arr;
	
	public bit(int myn) {
	
		// Get to a power of 2 > myn.
		n = 1;
		while (n < myn+5)
			n <<= 1;
			
		// Will store my bit sums.
		arr = new int[n];
	}
	
	public void add(int idx, int value) {
		
		// Add to positions in table that have idx as part of their responsibility.
		while (idx < n) {
			arr[idx] += value;
			idx += (idx & (-idx) );
		}
	}
	
	// Returns sum from index 1 to index idx.
	public int query(int idx) {
	
		// Add into sum all disjoint sets to cover range from index 1 to idx.
		int total = 0;
		while (idx > 0) {
			total += arr[idx];
			idx -= (idx & (-idx) );
		}
		
		return total;
	}
	
	// The exact bit query we want, so just write a method for it.
	public int sumAbove(int idx) {
		return query(n-1) - query(idx-1);
	}
}