import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

	Scanner in;
	PrintWriter out;

	static int INF = 1000000000;

	int[] queue;
	int start = 0,finish = 0;
	int[] d,ptr;
	int n, flow = 0;
	int x = 0,y = 0;
	int x1 = 0, y1 = 0;

	int[][] f,c;

	public BufferedReader input;
    public PrintWriter output;
    public StringTokenizer stoken = new StringTokenizer("");

	public static void main(String[] args) throws IOException,FileNotFoundException {
		new Main().run();
	}
	void run() throws IOException, FileNotFoundException {
		//in = new Scanner(new File("input.txt"));
		//out = new PrintWriter(new File("output.txt"));

		input = new BufferedReader(new InputStreamReader(System.in));
		//input = new BufferedReader(new FileReader("input.txt"));

		double st = System.nanoTime();
		//in = new Scanner(System.in);
		out = new PrintWriter(System.out);
		solve();
		//in.close();
		//System.out.print((System.nanoTime()-st)/1e9);
		out.close();
	}

	void solve() throws IOException {
		n = nextInt();
		Integer[] a = new Integer[n];
		for (int i = 0;i<n;++i) {
			a[i] = nextInt();
		}
		Arrays.sort(a, Collections.reverseOrder());
		//out.print(Arrays.toString(a));
		double s = 0.0;
		for (int i = 0;i<n;++i) {
			if (i%2==0) {
				s+=Math.PI*a[i]*a[i];
			} else s-=Math.PI*a[i]*a[i];
		}
		out.print(s);
	}

	public int nextInt() throws IOException, NumberFormatException {
		return Integer.parseInt(nextString());
	}
	public String nextString() throws IOException {
		while (!stoken.hasMoreTokens()) {
			String st = input.readLine();
			stoken = new StringTokenizer(st);
		}
		return stoken.nextToken();
	}
}


import java.io.IOException;
import java.util.Scanner;

/**
 *
 * @author s3ood
 */
public class Trace
{
    public static void main(String[] args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        int nOc = sc.nextInt();
        double sum = 0.0;
        int[]rad=new int[nOc];
        for(int j=0 ; j<nOc ; j++)
        {
            rad[j]=sc.nextInt();
        }
        java.util.Arrays.sort(rad);
        for (int i =nOc-1 ; i>=1-1 ; i-=2)
        {
            if(nOc%2==1 && i==0)
               sum = sum + (Math.PI*Math.pow(rad[i],2));
            else
                sum = sum + (Math.PI*Math.pow(rad[i],2)-(Math.PI*Math.pow(rad[i-1],2)));
        }
        System.out.println(sum);
    }

}


import java.io.IOException;
import java.util.Scanner;

/**
 *
 * @author s3ood
 */
public class Main
{
    public static void main(String[] args) throws IOException
    {
        Scanner sc = new Scanner(System.in);
        int nOc = sc.nextInt();
        double sum = 0.0;
        int[]rad=new int[nOc];
        for(int j=0 ; j<nOc ; j++)
        {
            rad[j]=sc.nextInt();
        }
        java.util.Arrays.sort(rad);
        for (int i =nOc-1 ; i>=1-1 ; i-=2)
        {
            if(nOc%2==1 && i==0)
               sum = sum + (Math.PI*Math.pow(rad[i],2));
            else
                sum = sum + (Math.PI*Math.pow(rad[i],2)-(Math.PI*Math.pow(rad[i-1],2)));
        }
        System.out.println(sum);
    }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        //BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        Scanner in=new Scanner(System.in);
        PrintWriter out=new PrintWriter(System.out);
        int n=in.nextInt();
        int[] mas=new int[n];
        for(int j=0; j<n; j++){
            mas[j]=in.nextInt();
        }
        Arrays.sort(mas);
        int count=0;
        int mnozh=1;
        for(int j=n-1; j>=0; j--){
            count+=mas[j]*mas[j]*mnozh;
            mnozh*=-1;
        }
        out.println(count*Math.PI);
        out.close();
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class P157B {

  public static void main(String[] args) {
    Scanner inScanner = new Scanner(System.in);
    int n = inScanner.nextInt();
    int[] radii = new int[n];
    for (int i = 0; i < n; i++) {
      radii[i] = inScanner.nextInt();
    }
    Arrays.sort(radii);
    int start = n % 2;
    int sum = 0;
    if (start == 1) {
      sum += radii[0] * radii[0];
    }
    for (int i = start; i < n - 1; i += 2) {
      sum += (radii[i + 1] * radii[i + 1] - radii[i] * radii[i]);
    }
    System.out.println(Math.PI * sum);
  }
}


import java.util.Arrays;
import java.util.Scanner;

public class P157B {

  public static void main(String[] args) {
    Scanner inScanner = new Scanner(System.in);
    int n = inScanner.nextInt();
    int[] radii = new int[n];
    for (int i = 0; i < n; i++) {
      radii[i] = inScanner.nextInt();
    }
    Arrays.sort(radii);
    int start = n % 2;
    int sum = 0;
    if (start == 1) {
      sum += radii[0] * radii[0];
    }
    for (int i = start; i < n - 1; ++i) {
      sum += (radii[i + 1] * radii[i + 1] - radii[i] * radii[i]);
    }
    System.out.println(Math.PI * sum);
  }
}


import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Main {
	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter pw;

	public static void main(String[] args) throws IOException	{
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = readInt();
		int[] list = new int[n];
		for(int i = 0; i < n; i++)
			list[i] = readInt();
		Arrays.sort(list);
		int amt = 0;
		boolean add = true;
		for(int i = n-1; i >= 0; i--)	{
			if(add)
				amt += list[i]*list[i];
			else
				amt -= list[i]*list[i];
			add = !add;
		}
		pw.println(Math.PI * amt);
		pw.close();
	}
	public static long readLong() throws IOException	{
		return Long.parseLong(nextToken());
	}
	public static double readDouble() throws IOException	{
		return Double.parseDouble(nextToken());
	}
	public static int readInt() throws IOException	{
		return Integer.parseInt(nextToken());
	}
	public static short readShort() throws IOException	{
		return Short.parseShort(nextToken());
	}
	public static String nextToken() throws IOException	{
		while(st == null || !st.hasMoreTokens())	{
			if(!br.ready())	{
				pw.close();
				System.exit(0);
			}
			st = new StringTokenizer(br.readLine());
		}
		return st.nextToken();
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class B110 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> rad = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			rad.add(sc.nextInt());
		}
		Collections.sort(rad);
		if (n == 1) {
			System.out.println(Math.PI*rad.get(0)*rad.get(0));
			return;
		}
		double area = 0.0d;
		for (int i = rad.size() - 1; i > 0; i = i - 2) {
			area += Math.PI
					* (Math.pow(new Double(rad.get(i)), 2) - Math.pow(
							new Double(rad.get(i - 1)), 2));
		}
		if (n % 2 != 0) {
			area += Math.PI * Math.pow(new Double(rad.get(0)), 2);
		}
		System.out.println(area);
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class B110 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> rad = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			rad.add(sc.nextInt());
		}
		Collections.sort(rad);
		double area = 0.0d;
		area= Math.PI * Math.pow(rad.get(0), 2);
		for (int i = 2; i < rad.size(); i=i+2) {
			area +=  Math.PI * (Math.pow(new Double(rad.get(i)),2) - Math.pow( new Double(rad.get(i-1)), 2));
		}
		System.out.println(area);
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class B110 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> rad = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			rad.add(sc.nextInt());
		}
		Collections.sort(rad);
		if (n == 1) {
			System.out.println(Math.PI);
			return;
		}
		double area = 0.0d;
		for (int i = rad.size() - 1; i > 0; i = i - 2) {
			area += Math.PI
					* (Math.pow(new Double(rad.get(i)), 2) - Math.pow(
							new Double(rad.get(i - 1)), 2));
		}
		if (n % 2 != 0) {
			area += Math.PI * Math.pow(new Double(rad.get(0)), 2);
		}
		System.out.println(area);
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class B110 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> rad = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			rad.add(sc.nextInt());
		}
		Collections.sort(rad);
		double area = 0.0d;
		area= Math.PI * Math.pow(rad.get(0), 2);
		for (int i = rad.size()-1; i > 1; i=i-2) {
			area +=  Math.PI * (Math.pow(new Double(rad.get(i)),2) - Math.pow( new Double(rad.get(i-1)), 2));
		}
		System.out.println(area);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Trace {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(reader.readLine());
		int a[]=new int [n];
		String st[]=reader.readLine().split(" ");
		for(int i=0;i<n;i++)
			a[i]=Integer.parseInt(st[i]);
		Arrays.sort(a);
		double count=0;
		if((n&1)!=0)
		{
		count+=Math.PI*Math.pow(a[0], 2);
		for(int i=2;i<n;i+=2)
		{
			count+=Math.PI*Math.pow(a[i], 2)-Math.PI*Math.pow(a[i-1], 2);
		}
		}
		else
		{

			for(int i=1;i<n;i+=2)
			{
				count+=Math.PI*Math.pow(a[i], 2)-Math.PI*Math.pow(a[i-1], 2);
			}
		}
		System.out.println(count);

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Trace {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(reader.readLine());
		int a[]=new int [n];
		String st[]=reader.readLine().split(" ");
		for(int i=0;i<n;i++)
			a[i]=Integer.parseInt(st[i]);
		Arrays.sort(a);
		double count=0;
		count+=Math.PI*Math.pow(a[0], 2);
		for(int i=2;i<n;i+=2)
		{
			count+=Math.PI*Math.pow(a[i], 2)-Math.PI*Math.pow(a[i-1], 2);
		}
		System.out.println(count);
	}

}


import java.util.PriorityQueue;
import java.util.Scanner;

public class Trace {

    public static void main(String[] args) {
        PriorityQueue<Integer> pq= new PriorityQueue<Integer>();
        Scanner s = new Scanner(System.in);
        while(s.hasNext())
        {
            int n = s.nextInt();

            while(n>0)
            {
            pq.add(s.nextInt());
            --n;
            }
        double area = Math.PI*Math.pow(pq.poll(), 2);

        while(!pq.isEmpty())
        {
            Integer a = pq.poll();
            Integer b = pq.poll();
            if(b == null)
                break;
            area +=( Math.PI*(Math.pow(b.intValue(), 2)-Math.pow(a.intValue(), 2)));
        }

        System.out.println(area);
        }

    }

}


import java.util.PriorityQueue;
import java.util.Scanner;

public class Trace {

    public static void main(String[] args) {
        PriorityQueue<Integer> pq= new PriorityQueue<Integer>();
        Scanner s = new Scanner(System.in);
        while(s.hasNext())
        {
            int n = s.nextInt();
            Integer c = null;
            while(n>0)
            {
                c = s.nextInt();
                if(!pq.contains(c) )
                    pq.add(c);
                    --n;
            }
        double area = Math.PI*Math.pow(pq.poll(), 2);

        while(!pq.isEmpty())
        {
            Integer a = pq.poll();
            Integer b = pq.poll();
            if(b == null)
                break;
            area +=( Math.PI*(Math.pow(b.intValue(), 2)-Math.pow(a.intValue(), 2)));
        }

        System.out.println(area);
        }

    }

}


import java.util.PriorityQueue;
import java.util.Scanner;

public class Trace {

    public static void main(String[] args) {
        PriorityQueue<MyCircle> pq= new PriorityQueue<MyCircle>();
        Scanner s = new Scanner(System.in);
        while(s.hasNext())
        {
            int n = s.nextInt();
            MyCircle c = null;
            while(n>0)
            {
                c = new MyCircle(s.nextInt());
                if(!pq.contains(c) )
                    pq.add(c);
                    --n;
            }

            double area = 0;
        while(!pq.isEmpty())
        {
            MyCircle a = pq.poll();
            MyCircle b = pq.poll();
            if(b == null)
            {
                area+=a.getArea();
                break;
            }
                area +=a.getArea()-b.getArea();
        }

        System.out.println(area);
        }

    }

}
class MyCircle implements Comparable<MyCircle>
{
     int radius;
    public MyCircle(int r)
    {
        radius = r;
    }
    public double getArea()
    {
        return Math.PI*Math.pow(radius, 2);
    }
    @Override
    public int compareTo(MyCircle o) {
        // TODO Auto-generated method stub
        if(this.radius > o.radius)
            return -1;
        else if(this.radius < o.radius)
            return 1;
        else
        return 0;
    }

}


import java.util.*;

public class Main {

	public static void main(String[] args) {

		// long start = System.currentTimeMillis();
		// long end = System.currentTimeMillis();
		// System.out.println(" Execution time was "+(end-start)+" ms.");

		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int a[] = new int[n];
		for(int i =0;i<n;i++){
			a[i] = kb.nextInt();
		}
		Arrays.sort(a);
		double area = 0;
		int count=0;
		for(int i=n-1;i>=0;i--){
			if(count%2==0)
				area+=Math.PI*(double)(a[i]*a[i]);
			else
				area-=Math.PI*(double)(a[i]*a[i]);
			count++;
		}
		System.out.println(area);
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class TaskB {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int numOfCircles = s.nextInt();
        int[] rad = new int[100];
        double res = 0.0;

        for (int i = 0; i < numOfCircles; i++)
            rad[i] = s.nextInt();

        Arrays.sort(rad, 0, numOfCircles);

        for (int i = numOfCircles - 1; i > 0; i = i - 2)
            res += (rad[i] - rad[i-1]) * (rad[i] + rad[i-1]);

        if (numOfCircles % 2 == 1)
            res += rad[0]*rad[0];

        System.out.println(Math.PI * res);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class TaskB {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int numOfCircles = s.nextInt();
        int[] rad = new int[100];
        double res = 0.0;

        for (int i = 0; i < numOfCircles; i++)
            rad[i] = s.nextInt();

        Arrays.sort(rad, 0, numOfCircles);

        if (numOfCircles == 1) {
            System.out.print(Math.PI * rad[0]);
            return;
        }

        for (int i = numOfCircles - 1; i > 0; i = i - 2)
            res += rad[i]*rad[i] - rad[i - 1]*rad[i - 1];

        if (numOfCircles % 2 == 1)
            res += rad[0]*rad[0];

        System.out.println(res * Math.PI);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Trace {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] r = new int[n];

        for (int i = 0; i < n; i++)
            r[i] = in.nextInt();

        Arrays.sort(r);

        boolean isRed = true;
        double red = 0.0d, blue = 0.0d;
        for (int i = n - 1; i >= 0; i--) {
            if (isRed)
                red += r[i] * r[i];
            else
                blue = r[i] * r[i];
            isRed = !isRed;
        }

        double res = Math.PI * (red - blue);
        System.out.println(res);
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Trace {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] r = new int[n];

        for (int i = 0; i < n; i++)
            r[i] = in.nextInt();

        Arrays.sort(r);

        boolean red = true;
        double res = 0.0d;
        for (int i = n - 1; i >= 0; i--) {
            if (red) {
                if (i == 0)
                    res += r[i] * r[i];
                else
                    res += r[i] * r[i] - r[i - 1] * r[i - 1];
            }
            red = !red;
        }

        res *= Math.PI;
        System.out.println(res);
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class _157B {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] radii = new int[n];
        for (int i = 0; i < n; i++) radii[i] = scan.nextInt();
        Arrays.sort(radii);
        double area = 0;
        for (int i = 0; i < n; i++) area += Math.pow(-1, i)*radii[(n-1) - i]*radii[(n-1) - i];
        area *= Math.PI;
        System.out.println(area);
    }

}


import java.io.BufferedInputStream;
import java.util.*;
import static java.lang.Math.*;

public class C157B {

	public void solve() throws Exception {
		int n = nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = nextInt();
		}
		Arrays.sort(arr);
		double res = 0;
		int plusMinus = 1;
		for (int i = n - 1; i >= 0; i--) {
			res += plusMinus * PI * arr[i] * arr[i];
			plusMinus *= -1;
		}
		println(res);
	}

	// ------------------------------------------------------

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}

	void print(Object... os) {
		if (os != null && os.length > 0)
			System.out.print(os[0].toString());
		for (int i = 1; i < os.length; ++i)
			System.out.print(" " + os[i].toString());
	}

	void println(Object... os) {
		print(os);
		System.out.println();
	}

	BufferedInputStream bis = new BufferedInputStream(System.in);

	String nextWord() throws Exception {
		char c = (char) bis.read();
		while (c <= ' ')
			c = (char) bis.read();
		StringBuilder sb = new StringBuilder();
		while (c > ' ') {
			sb.append(c);
			c = (char) bis.read();
		}
		return new String(sb);
	}

	String nextLine() throws Exception {
		char c = (char) bis.read();
		while (c <= ' ')
			c = (char) bis.read();
		StringBuilder sb = new StringBuilder();
		while (c != '\n' && c != '\r') {
			sb.append(c);
			c = (char) bis.read();
		}
		return new String(sb);
	}

	int nextInt() throws Exception {
		return Integer.parseInt(nextWord());
	}

	long nextLong() throws Exception {
		return Long.parseLong(nextWord());
	}

	public static void main(String[] args) throws Exception {
		new C157B().solve();
	}
}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class B {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = sc.nextInt();

        int pow = 0;
        double ans = 0;
        Arrays.sort(a);
        for (int i = 0; i < n; i++) {
            ans += Math.pow(-1, pow) * a[i] * a[i];
            pow++;
        }

        pw.print(ans * Math.PI);
        pw.close();
    }

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class B {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = sc.nextInt();

        int pow = 0;
        double ans = 0;
        Arrays.sort(a);
        for (int i = n-1; i > -1; i--) {
            ans += Math.pow(-1, pow) * a[i] * a[i];
            pow++;
        }

        pw.print(ans * Math.PI);
        pw.close();
    }

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class B110 {

	/**
	 * @param args
	 */

	static final double inf = Double.MAX_VALUE / 11;
	  int kvad(int a) {return a*a;}
	  double kvad(double a) {return a*a;}
	  int gcd(int a, int b) {int c;while (a!=0) {c = a;a = b%a;b = c;}return b;}
	  private HashMap memo = new HashMap();
	  static final int antInd = 4;

	private void run() throws IOException{

		int n=nextInt();
		int[] a=new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i]=nextInt();
		}
		Arrays.sort(a);
		double res=0;
		if(a.length%2!=0){
			res=Math.PI*(Math.pow(a[0], 2));
			for (int i = 1; i < a.length-1; i+=2) {
				res+=((Math.PI*(Math.pow(a[i+1], 2)))- (Math.PI*(Math.pow(a[i], 2))));

			}

		}
		else {

			for (int i = 0; i < a.length-1; i+=2) {
				res+=((Math.PI*(Math.pow(a[i+1], 2)))- (Math.PI*(Math.pow(a[i], 2))));

			}

		}

		System.out.println(res);

	}

	private int nextInt() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Integer.parseInt(input.nextToken());
	}
	private long nextLong() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Long.parseLong(input.nextToken());
	}
	private double nextDouble() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Double.parseDouble(input.nextToken());
	}
	private String nextString() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return input.nextToken();
	}
	private void write(String output){
		out.write(output);
		out.flush();
	}
	private void writeln(String output){
		out.write(output+"\n");
//		out.flush();
	}
	private void end() throws IOException{
		in.close();
		out.close();
		System.exit(0);
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer input;

	public B110 () throws IOException {
		//Input Output for Console to be used for trying the test samples of the problem
//		in = new BufferedReader(new InputStreamReader(System.in));
//		out = new PrintWriter(System.out);
		//-------------------------------------------------------------------------
		//Input Output for File to be used for solving the small and large test files
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter("clocks.out");
		//-------------------------------------------------------------------------
		//Initialize Stringtokenizer input
		input = new StringTokenizer(in.readLine());
	}

	public static void main(String[] args) throws Exception {
		//-------------------------------------------------------------------------
		//initializing...
		B110  sol = new B110 ();
		//-------------------------------------------------------------------------
		sol.run();
		//-------------------------------------------------------------------------
		//closing up
		sol.end();
		//--------------------------------------------------------------------------
	}

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class B110 {

	/**
	 * @param args
	 */

	static final double inf = Double.MAX_VALUE / 11;
	  int kvad(int a) {return a*a;}
	  double kvad(double a) {return a*a;}
	  int gcd(int a, int b) {int c;while (a!=0) {c = a;a = b%a;b = c;}return b;}
	  private HashMap memo = new HashMap();
	  static final int antInd = 4;

	private void run() throws IOException{

		int n=nextInt();
		int[] a=new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i]=nextInt();
		}
		Arrays.sort(a);
		double res=Math.PI*(Math.pow(a[0], 2));

		for (int i = 1; i < a.length-1; i+=2) {
			res+=(Math.PI*(Math.pow(a[i+1], 2))- Math.PI*(Math.pow(a[i], 2)));

		}
		System.out.println(res);

	}

	private int nextInt() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Integer.parseInt(input.nextToken());
	}
	private long nextLong() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Long.parseLong(input.nextToken());
	}
	private double nextDouble() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Double.parseDouble(input.nextToken());
	}
	private String nextString() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return input.nextToken();
	}
	private void write(String output){
		out.write(output);
		out.flush();
	}
	private void writeln(String output){
		out.write(output+"\n");
//		out.flush();
	}
	private void end() throws IOException{
		in.close();
		out.close();
		System.exit(0);
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer input;

	public B110 () throws IOException {
		//Input Output for Console to be used for trying the test samples of the problem
//		in = new BufferedReader(new InputStreamReader(System.in));
//		out = new PrintWriter(System.out);
		//-------------------------------------------------------------------------
		//Input Output for File to be used for solving the small and large test files
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter("clocks.out");
		//-------------------------------------------------------------------------
		//Initialize Stringtokenizer input
		input = new StringTokenizer(in.readLine());
	}

	public static void main(String[] args) throws Exception {
		//-------------------------------------------------------------------------
		//initializing...
		B110  sol = new B110 ();
		//-------------------------------------------------------------------------
		sol.run();
		//-------------------------------------------------------------------------
		//closing up
		sol.end();
		//--------------------------------------------------------------------------
	}

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class B110 {

	/**
	 * @param args
	 */

	static final double inf = Double.MAX_VALUE / 11;
	  int kvad(int a) {return a*a;}
	  double kvad(double a) {return a*a;}
	  int gcd(int a, int b) {int c;while (a!=0) {c = a;a = b%a;b = c;}return b;}
	  private HashMap memo = new HashMap();
	  static final int antInd = 4;

	private void run() throws IOException{

		int n=nextInt();
		int[] a=new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i]=nextInt();
		}
		Arrays.sort(a);
		double res=0;
		if(a.length%2!=0)res=Math.PI*(Math.pow(a[0], 2));

		for (int i = 1; i < a.length-1; i+=2) {
			res+=((Math.PI*(Math.pow(a[i+1], 2)))- (Math.PI*(Math.pow(a[i], 2))));

		}

		System.out.println(res);

	}

	private int nextInt() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Integer.parseInt(input.nextToken());
	}
	private long nextLong() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Long.parseLong(input.nextToken());
	}
	private double nextDouble() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return Double.parseDouble(input.nextToken());
	}
	private String nextString() throws IOException {
		if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
		return input.nextToken();
	}
	private void write(String output){
		out.write(output);
		out.flush();
	}
	private void writeln(String output){
		out.write(output+"\n");
//		out.flush();
	}
	private void end() throws IOException{
		in.close();
		out.close();
		System.exit(0);
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer input;

	public B110 () throws IOException {
		//Input Output for Console to be used for trying the test samples of the problem
//		in = new BufferedReader(new InputStreamReader(System.in));
//		out = new PrintWriter(System.out);
		//-------------------------------------------------------------------------
		//Input Output for File to be used for solving the small and large test files
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter("clocks.out");
		//-------------------------------------------------------------------------
		//Initialize Stringtokenizer input
		input = new StringTokenizer(in.readLine());
	}

	public static void main(String[] args) throws Exception {
		//-------------------------------------------------------------------------
		//initializing...
		B110  sol = new B110 ();
		//-------------------------------------------------------------------------
		sol.run();
		//-------------------------------------------------------------------------
		//closing up
		sol.end();
		//--------------------------------------------------------------------------
	}

}


import java.util.*;

public class Main {
    public static Scanner scan = new Scanner(System.in);

    public static void main(String[] args) {
        int n1 = Integer.parseInt(scan.next());
        int[] l1 = new int[n1];
        for (int i=0;i<n1;i++){
            l1[i]= Integer.parseInt(scan.next());
        }
        Arrays.sort(l1);
        double fin  =0.0;
        int fact = 1;
        for (int i=0;i<n1;i++){
            int k1 = l1[l1.length-i-1];
            fin+=fact*(k1*k1*Math.PI);
            fact*=-1;
        }
        System.out.println(fin);
    }
}


/**
 * Mx NINJA 04:05:13 ص 03/02/2014
 */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(reader.readLine());
        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        Integer[] circles = new Integer[n];
        for (int i = 0; i < n; i++) {
            circles[i] = Integer.parseInt(tokenizer.nextToken());
        }
        java.util.Arrays.sort(circles, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                if (o1 > o2) {
                    return -1;
                }
                if (o1 < o2) {
                    return 1;
                }
                return 0;
            }
        });
        double sumRedSpace = 0.0;
        for(int i=0;i+1<n;i+=2){
            double outer = Math.pow(circles[i], 2)*Math.PI;
            double inner = Math.pow(circles[i+1], 2)*Math.PI;
            sumRedSpace+=(outer-inner);
        }
        if(n%2!=0){
            sumRedSpace+=(Math.pow(circles[n-1], 2)*Math.PI);
        }
        DecimalFormat format = new DecimalFormat();
        format.setMaximumFractionDigits(10);
        System.out.println(format.format(sumRedSpace));
    }
}


/**
 * Mx NINJA 04:05:13 ص 03/02/2014
 */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(reader.readLine());
        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        Integer[] circles = new Integer[n];
        for (int i = 0; i < n; i++) {
            circles[i] = Integer.parseInt(tokenizer.nextToken());
        }
        java.util.Arrays.sort(circles, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                if (o1 > o2) {
                    return -1;
                }
                if (o1 < o2) {
                    return 1;
                }
                return 0;
            }
        });
        double sumRedSpace = 0.0;
        for(int i=0;i+1<n;i+=2){
            double outer = Math.pow(circles[i], 2)*Math.PI;
            double inner = Math.pow(circles[i+1], 2)*Math.PI;
            sumRedSpace+=(outer-inner);
        }
        if(n%2!=0){
            sumRedSpace+=(Math.pow(circles[n-1], 2)*Math.PI);
        }
        System.out.println(sumRedSpace);
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import java.util.logging.StreamHandler;

public class A2 {
	static Scanner in; static int next() throws Exception {return in.nextInt();};
//	static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;}
//	static BufferedReader in;
	static PrintWriter out;

	public static void main(String[] args) throws Exception {
		in = new Scanner(System.in);
//		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
//		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

        int n = next(), deg = -1;
        double sq = 0, pi = 3.141592653589793;
        double r[] = new double[n];
        for (int i = 0;i < n;i++) {
            r[i] = next();
        }
        Arrays.sort(r);
        for (int i = n-1;i >= 0;i--) {
            sq += deg*r[i]*r[i];
            sq *= -1;
 //           out.print(sq + " ");
        }

        out.print(sq*pi);

        out.println();
		out.close();
	}
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import java.util.logging.StreamHandler;

public class A2 {
	static Scanner in; static int next() throws Exception {return in.nextInt();};
//	static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;}
//	static BufferedReader in;
	static PrintWriter out;

	public static void main(String[] args) throws Exception {
		in = new Scanner(System.in);
//		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
//		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

        int n = next(), deg = -1;
        double sq = 0, pi = 3.141592653589793;
        double r[] = new double[n];
        for (int i = 0;i < n;i++) {
            r[i] = next();
        }
        Arrays.sort(r);
        for (int i = n-1;i >= 0;i--) {
            sq += deg*r[i]*r[i]*pi;
            sq *= -1;
 //           out.print(sq + " ");
        }

        out.print(sq);

        out.println();
		out.close();
	}
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import java.util.logging.StreamHandler;

public class A2 {
	static Scanner in; static int next() throws Exception {return in.nextInt();};
//	static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;}
//	static BufferedReader in;
	static PrintWriter out;

	public static void main(String[] args) throws Exception {
		in = new Scanner(System.in);
//		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
//		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

        int n = next(), deg = 1;
        double sq = 0, pi = 3.141592653589793;
        double r[] = new double[n];
        for (int i = 0;i < n;i++) {
            r[i] = next();
        }
        Arrays.sort(r);
   //     for (int i = 0;i < n;i++) out.print(r[i] + " ");
        for (int i = n-1;i >= 0;i--) {
            sq += deg*r[i]*r[i];
            deg *= -1;
        }

        out.print(sq*pi);

        out.println();
		out.close();
	}
}


import string

def f(words):

    def dfs(node):
        color[node] = 'g'
        for child in g[node]:
            if color[child] == 'b':
                continue
            elif color[child] == 'g':
                return False
            else:
                if dfs(child):
                    continue
                else:
                    return False
        color[node] = 'b'
        order.append(node)
        return True

    g = {}
    for char in string.ascii_lowercase:
        g[char] = set()

    for i in range(n-1):
        j = 0
        while j < min(len(words[i]), len(words[i+1])):
            g[words[i][j]].add(words[i+1][j])
            if words[i][j] == words[i+1][j]:
                j += 1
                continue
            else:
                break

    order = []
    color = {node:'w' for node in g}
    for node in g:
        if color[node] == 'w':
            if dfs(node):
                continue
            else:
                return False, []
    return True, order[::-1]

n = int(input())
words  = []
for i in range(n):
    words.append(input())
possible, order = f(words)
if possible:
    print(''.join(order))
else:
    print('Impossible')


import string

def f(words):

    def dfs(node):
        color[node] = 'g'
        for child in g[node]:
            if color[child] == 'b':
                continue
            elif color[child] == 'g':
                return False
            else:
                if dfs(child):
                    continue
                else:
                    return False
        color[node] = 'b'
        order.append(node)
        return True

    g = {}
    for char in string.ascii_lowercase:
        g[char] = set()

    for i in range(n-1):
        j = 0
        while j < min(len(words[i]), len(words[i+1])) and words[i][j] == words[i+1][j]:
            j += 1
        if j == len(words[i]) or j == len(words[i+1]):
            continue
        else:
            g[words[i][j]].add(words[i+1][j])

    order = []
    color = {node:'w' for node in g}
    for node in g:
        if color[node] == 'w':
            if dfs(node):
                continue
            else:
                return False, []
    return True, order

n = int(input())
words  = []
for i in range(n):
    words.append(input())
possible, order = f(words)
if possible:
    print(''.join(order))
else:
    print('Impossible')


import string

n = int(input())

prev = None
flag = False
nodes = {}

for i in string.ascii_lowercase:
    nodes[i] = set()

for i in range(n):
    name = input()

    if prev:
        for x, y in zip(name, prev):
            if x != y:
                nodes[x].add(y)
                break
        else:
            if prev > name:
                flag = True
                break
    prev = name

a = []
b = []

for i in "abcdefghijklmnopqrstuvwxyz":
    if not nodes[i]:
        a.append(i)
    else:
        b.append(i)

c = []

while a:
    d = a.pop()
    c.append(d)

    for i in b[:]:
        if d in nodes[i]:
            nodes[i].remove(d)
            if not nodes[i]:
                a.append(i)
                b.remove(i)

if b or flag:
    print("Impossible")
else:
    print("".join(c))


import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
##########################################################
#from fractions import Fraction
# import math
import sys
import math
from math import gcd
# from collections import deque
# from collections import Counter
#import sys
#ys.setrecursionlimit(10 ** 6)
#for _ in range(int(input())):
#n, k = map(int, input().split())
#from bisect import bisect_right
#n =int(input())
#for _ in range(int(input())):
import bisect
#for _ in range(int(input())):
#n, m =map(int,input().split())
#for _ in (int(input())):
#open("output.txt","w").write(s)
#n=int(open("input.txt").read())
#open("output.txt","w").write(s)
#arr=list(map(int,input().split()))
# n =int(input())
a=[0]*26
'''for _ in range(int(input())):
    n = int(input())

    arr = list(map(int, input().split()))'''
from collections import deque
#n, m =map(int,input().split())
n = int(input())
g=[set() for i in range(26)]
a=input()
v=[0]*26
for  i in range(1,n):
    b=input()
    j=0
    while j<min(len(a),len(b)) and a[j]!=b[j]:j+=1
    if j<min(len(a),len(b)) and a[j]!=b[j]:
        g[ord(a[j])-97].add(ord(b[j])-97)
    elif len(a)>len(b):
        print("Impossible")
        exit()
    a=b
ans=[]
def dfs(s):
    v[s]=1
    for j in g[s]:
        if v[j]==1:
            print("Impossible")  ###### check DAF directed acylic graph

            exit()
        if v[j]==0:
            dfs(j)

    ans.append(chr(s+97))

for i in range(26):
    if v[i]==0:
        dfs(i)
print("".join(reversed(ans)))


import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
##########################################################
#from fractions import Fraction
# import math
import sys
import math
from math import gcd
# from collections import deque
# from collections import Counter
#import sys
#ys.setrecursionlimit(10 ** 6)
#for _ in range(int(input())):
#n, k = map(int, input().split())
#from bisect import bisect_right
#n =int(input())
#for _ in range(int(input())):
import bisect
#for _ in range(int(input())):
#n, m =map(int,input().split())
#for _ in (int(input())):
#open("output.txt","w").write(s)
#n=int(open("input.txt").read())
#open("output.txt","w").write(s)
#arr=list(map(int,input().split()))
# n =int(input())
a=[0]*26
'''for _ in range(int(input())):
    n = int(input())

    arr = list(map(int, input().split()))'''
from collections import deque
#n, m =map(int,input().split())
n = int(input())
g=[set() for i in range(26)]
a=input()
v=[0]*26
for  i in range(1,n):
    b=input()
    j=0
    while j<min(len(a),len(b)) and a[j]==b[j]:j+=1
    if j<min(len(a),len(b)) and a[j]!=b[j]:
        g[ord(a[j])-97].add(ord(b[j])-97)
    elif len(a)>len(b):
        print("Impossible")
        exit()
    a=b
ans=[]
def dfs(s):
    v[s]=1
    for j in g[s]:
        if v[j]==1:
            print("Impossible")  ###### check DAF directed acylic graph
            exit()

        if v[j]==0:
            dfs(j)
    ans.append(chr(s+97))
for i in range(26):
    if v[i]==0:
        dfs(i)
print("".join(reversed(ans)))


import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
##########################################################
#from fractions import Fraction
# import math
import sys
import math
from math import gcd
# from collections import deque
# from collections import Counter
#import sys
#ys.setrecursionlimit(10 ** 6)
#for _ in range(int(input())):
#n, k = map(int, input().split())
#from bisect import bisect_right
#n =int(input())
#for _ in range(int(input())):
import bisect
#for _ in range(int(input())):
#n, m =map(int,input().split())
#for _ in (int(input())):
#open("output.txt","w").write(s)
#n=int(open("input.txt").read())
#open("output.txt","w").write(s)
#arr=list(map(int,input().split()))
# n =int(input())
a=[0]*26
'''for _ in range(int(input())):
    n = int(input())

    arr = list(map(int, input().split()))'''
from collections import deque
#n, m =map(int,input().split())
n = int(input())
g=[set() for i in range(26)]
a=input()
v=[0]*26
for  i in range(1,n):
    b=input()
    j=0
    while j<min(len(a),len(b)) and a[j]!=b[j]:j+=1
    if j<min(len(a),len(b)) and a[j]!=b[j]:
        g[ord(a[j])-97].add(ord(b[j])-97)
    elif len(a)>len(b):
        print("Impossible")
        exit()
    a=b
ans=[]
def dfs(s):
    v[s]=1
    for j in g[s]:
        if v[j]==1:
            print("Impossible")  ###### check DAF directed acylic graph
            exit()

        if v[j]==0:
            dfs(j)
    v[s] = 2

    ans.append(chr(s+97))

for i in range(26):
    if v[i]==0:
        dfs(i)
print("".join(reversed(ans)))


import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
##########################################################
#from fractions import Fraction
# import math
import sys
import math
from math import gcd
# from collections import deque
# from collections import Counter
#import sys
#ys.setrecursionlimit(10 ** 6)
#for _ in range(int(input())):
#n, k = map(int, input().split())
#from bisect import bisect_right
#n =int(input())
#for _ in range(int(input())):
import bisect
#for _ in range(int(input())):
#n, m =map(int,input().split())
#for _ in (int(input())):
#open("output.txt","w").write(s)
#n=int(open("input.txt").read())
#open("output.txt","w").write(s)
#arr=list(map(int,input().split()))
# n =int(input())
a=[0]*26
'''for _ in range(int(input())):
    n = int(input())

    arr = list(map(int, input().split()))'''
from collections import deque
#n, m =map(int,input().split())
n = int(input())
g=[set() for i in range(26)]
a=input()
v=[0]*26
for  i in range(1,n):
    b=input()
    j=0
    while j<min(len(a),len(b)) and a[j]==b[j]:j+=1
    if j<min(len(a),len(b)) and a[j]!=b[j]:
        g[ord(a[j])-97].add(ord(b[j])-97)
    elif len(a)>len(b):
        print("Impossible")
        exit()
    a=b
ans=[]
def dfs(s):
    v[s]=1
    for j in g[s]:
        if v[j]==1:
            print("Impossible")  ###### check DAF directed acylic graph
            exit()

        if v[j]==0:
            dfs(j)
    v[s]=2
    ans.append(chr(s+97))
for i in range(26):
    if v[i]==0:
        dfs(i)
print("".join(reversed(ans)))


import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
##########################################################
#from fractions import Fraction
# import math
import sys
import math
from math import gcd
# from collections import deque
# from collections import Counter
#import sys
#ys.setrecursionlimit(10 ** 6)
#for _ in range(int(input())):
#n, k = map(int, input().split())
#from bisect import bisect_right
#n =int(input())
#for _ in range(int(input())):
import bisect
#for _ in range(int(input())):
#n, m =map(int,input().split())
#for _ in (int(input())):
#open("output.txt","w").write(s)
#n=int(open("input.txt").read())
#open("output.txt","w").write(s)
#arr=list(map(int,input().split()))
# n =int(input())
a=[0]*26
'''for _ in range(int(input())):
    n = int(input())

    arr = list(map(int, input().split()))'''
from collections import deque
#n, m =map(int,input().split())
n = int(input())
names=[]
s=""
pre=""
f=0
for  i in range(n):
    var=input()
    if i==0:
        s+=var[0]
        pre=var
        a[ord(var[0]) - 97] = 1
        continue
    j=0
    k=0
    while j<len(pre) and k<len(var):
        if var[k]!=pre[j]:
            if a[ord(var[k])-97]==0:
                a[ord(var[k])-97]=1
            else:
                f=1
            s+=var[k]

            break
        j+=1
        k+=1
    names.append(var)
    pre=var
if f==1:
    print("Impossible")
else:
    for i in range(26):
        if a[i]==0:
            s+=chr(97+i)

    print(s)


import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
##########################################################
#from fractions import Fraction
# import math
import sys
import math
from math import gcd
# from collections import deque
# from collections import Counter
#import sys
#ys.setrecursionlimit(10 ** 6)
#for _ in range(int(input())):
#n, k = map(int, input().split())
#from bisect import bisect_right
#n =int(input())
#for _ in range(int(input())):
import bisect
#for _ in range(int(input())):
#n, m =map(int,input().split())
#for _ in (int(input())):
#open("output.txt","w").write(s)
#n=int(open("input.txt").read())
#open("output.txt","w").write(s)
#arr=list(map(int,input().split()))
# n =int(input())
a=[0]*26
'''for _ in range(int(input())):
    n = int(input())

    arr = list(map(int, input().split()))'''
from collections import deque
#n, m =map(int,input().split())
n = int(input())
names=[]
s=""
pre=""
f=0
for  i in range(n):
    var=input()
    if i==0:
        s+=var[0]
        pre=var
        continue
    j=0
    k=0
    while j<len(pre) and k<len(var):
        if var[k]!=pre[j]:
            if a[ord(var[k])-97]==0:
                a[ord(var[k])-97]=1
            else:
                f=1
            s+=var[k]

            break
        j+=1
        k+=1
    names.append(var)
    pre=var
if f==1:
    print("Impossible")
else:
    for i in range(26):
        if a[i]==0:
            s+=chr(97+i)

    print(s)


from string import ascii_lowercase as ascii

def go(v, order, color, cur):
	if color[v] == 1:
		return False
	if color[v] == 2:
		return True
	color[v] = 1
	for u in gr[v]:
		if not go(u, order, color, cur):
			return False
	order[v] = cur[0]
	cur[0] += 1
	color[v] = 2
	return True

n = int(input())
l = []
for i in range(n):
	l.append(input())
gr = {c: [] for c in ascii}
for a, b in zip(l[:-1], l[1:]):
	for x, y in zip(a, b):
		if x == y:
			continue
		gr[x].append(y)
		break
	else:
		if len(a) > len(b):
			print('Impossible')
			exit(0)
order = {c: -1 for c in ascii}
color = {c: 0 for c in ascii}
cur = [0]
for v in gr:
	if not go(v, order, color, cur):
		print('Impossible')
		exit(0)
print(''.join(a for a, b in sorted(order.items(), key=lambda p: -p[1])))


n = int(input())
nrLit = ord('z') - ord('a') + 1
v = [[0 for i in range(nrLit)] for j in range(nrLit)]
s0 = input()
posibil = True
for i in range(1, n):
    if not posibil:
        break
    s = input()
    mini = min(len(s0), len(s))
    for j in range(mini):
        a = ord(s0[j]) - ord('a')
        b = ord(s[j]) - ord('a')
        if s0[j] != s[j]:
            if v[a][b] <= 0 and v[b][a] >= 0:
                v[a][b] = -1
                v[b][a] = 1
            else:
                posibil = False
            break
    s0 = s

if not posibil:
    print("Impossible")
else:
    marcat = set()
    s = ""
    for lit in range(nrLit):
        for i in range(nrLit):
            if i in marcat:
                continue
            for j in range(nrLit):
                if v[i][j] == 1 and j not in marcat:
                    break
            else:
                s = s + (chr(i + ord('a')))
                marcat.add(i)
                break
    print(s)


n = int(input())
nrLit = ord('z') - ord('a') + 1
v = [[0 for i in range(nrLit)] for j in range(nrLit)]
s0 = input()
posibil = True
for i in range(1, n):
    if not posibil:
        break
    s = input()
    mini = min(len(s0), len(s))
    for j in range(mini):
        a = ord(s0[j]) - ord('a')
        b = ord(s[j]) - ord('a')
        if s0[j] != s[j]:
            if v[a][b] <= 0 and v[b][a] >= 0:
                v[a][b] = -1
                v[b][a] = 1
                for k in range(nrLit):
                    if v[k][a] == -1:
                        if v[b][k] >= 0:
                            v[k][b] = -1
                            v[b][k] = 1
                        else:
                            posibil = False

            else:
                posibil = False
            break
    else:
        if s0 > s:
            posibil = False
    s0 = s

if not posibil:
    print("Impossible")
else:
    marcat = set()
    s = ""
    for lit in range(nrLit):
        for i in range(nrLit):
            if i in marcat:
                continue
            for j in range(nrLit):
                if v[i][j] == 1 and j not in marcat:
                    break
            else:
                s = s + (chr(i + ord('a')))
                marcat.add(i)
                break
    print(s)


n = int(input())
nrLit = ord('z') - ord('a') + 1
v = [[0 for i in range(nrLit)] for j in range(nrLit)]
s0 = input()
posibil = True
for i in range(1, n):
    if not posibil:
        break
    s = input()
    mini = min(len(s0), len(s))
    for j in range(mini):
        a = ord(s0[j]) - ord('a')
        b = ord(s[j]) - ord('a')
        if s0[j] != s[j]:
            if v[a][b] <= 0 and v[b][a] >= 0:
                v[a][b] = -1
                v[b][a] = 1
                for k in range(nrLit):
                    if v[k][a] == -1:
                        if v[b][k] >= 0:
                            v[k][b] = -1
                            v[b][k] = 1
                        else:
                            posibil = False

            else:
                posibil = False
            break
    s0 = s

if not posibil:
    print("Impossible")
else:
    marcat = set()
    s = ""
    for lit in range(nrLit):
        for i in range(nrLit):
            if i in marcat:
                continue
            for j in range(nrLit):
                if v[i][j] == 1 and j not in marcat:
                    break
            else:
                s = s + (chr(i + ord('a')))
                marcat.add(i)
                break
    print(s)


n = int(input())
arr = []
for testcase in range(n):
  arr.append(input())

flag = 0
dicts = {}
curstr = arr[0]
#print(arr)
for i in range(1, n):
  flag2 = 0
  newstr = arr[i]
  minlen = min( len(newstr), len(curstr) )
  for j in range(minlen):
    if newstr[j] != curstr[j]:
      if curstr[j] not in dicts:
        dicts[curstr[j]] = []
      dicts[curstr[j]].append(newstr[j])
      flag2 = 1
      break
  if(flag2==0):
    if(len(newstr)<len(curstr)):
      flag = 1
  curstr = newstr
strs = ""
# for key, value in dicts.items():
#   for val in value:
#     if val in strs:
#       flag = 1
#       break
#   if flag == 1:
#     break
#   if key in value:
#     flag = 1
#     break
#   strs += key
#   for val in value:
#     strs += val
# print(dicts)
outdegree = {} #dictonary
for key,value in dicts.items():
  for val in value:
    if val not in outdegree:
        outdegree[val] = 0
    outdegree[val] += 1
q = []
strs = ""
for i in range(97, 97 + 26):
  #a....z
  curchar = chr(i)
  if curchar not in outdegree:
    q.append(curchar)
while len(q):
  u = q[-1]
  q.pop()
  strs += u
  if u not in dicts:
      continue
  for val in dicts[u]:
    outdegree[val] -= 1;
    if(outdegree[val] == 0 ):
      q.append(val);

if len(strs) != 26 or flag == 1:
  print("Impossible")
else:
  print(strs)


n = int(input())
arr = []
for testcase in range(n):
  arr.append(input())

dicts = {}
curstr = arr[0]
#print(arr)
for i in range(1, n):
  newstr = arr[i]
  minlen = min( len(newstr), len(curstr) )
  for j in range(minlen):
    if newstr[j] != curstr[j]:
      if curstr[j] not in dicts:
        dicts[curstr[j]] = []
      dicts[curstr[j]].append(newstr[j])
      break
  curstr = newstr
strs = ""
flag = 0
# for key, value in dicts.items():
#   for val in value:
#     if val in strs:
#       flag = 1
#       break
#   if flag == 1:
#     break
#   if key in value:
#     flag = 1
#     break
#   strs += key
#   for val in value:
#     strs += val
# print(dicts)
outdegree = {} #dictonary
for key,value in dicts.items():
  for val in value:
    if val not in outdegree:
        outdegree[val] = 0
    outdegree[val] += 1
q = []
strs = ""
for i in range(97, 97 + 26):
  #a....z
  curchar = chr(i)
  if curchar not in outdegree:
    q.append(curchar)
while len(q):
  u = q[-1]
  q.pop()
  strs += u
  if u not in dicts:
      continue
  for val in dicts[u]:
    outdegree[val] -= 1;
    if(outdegree[val] == 0 ):
      q.append(val);

if len(strs) != 26:
  print("Impossible")
else:
  print(strs)


import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../../input.txt')
# sys.stdin = f

def tn(c): return ord(c)-ord('a')

def main():
    n = N()
    arr = [input() for _ in range(n)]
    gp = [[] for _ in range(26)]
    res = []
    tag = True
    for i in range(n-1):
        now = 0
        l1, l2 = len(arr[i]), len(arr[i+1])
        while now<l1 and now<l2 and arr[i][now]==arr[i+1][now]:
            now+=1

        if now<l1 and now<l2:
            ca, cb = tn(arr[i][now]), tn(arr[i + 1][now])
            gp[ca].append(cb)
        else:
            if l1>l2: tag = False
    res = []
    vis = [0]*26

    def dfs(node):
        vis[node] = 1
        nonlocal tag
        for nex in gp[node]:
            if vis[nex]==1: tag = False; continue
            if vis[nex]==0: dfs(nex)
        vis[node] = 2
        res.append(node)

    for i in range(26):
        if vis[i]==0:
            dfs(i)

    if tag==False:
        print("Impossible")
    else:
        print("".join([chr(ord('a')+i) for i in res[::-1]]))

if __name__ == "__main__":
    main()


import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../../input.txt')
# sys.stdin = f

def tn(c): return ord(c)-ord('a')

def main():
    n = N()
    arr = [input() for _ in range(n)]
    gp = [[] for _ in range(26)]
    res = []
    tag = True
    for i in range(n-1):
        now = 0
        l1, l2 = len(arr[i]), len(arr[i+1])
        while now<l1 and now<l2 and arr[i][now]==arr[i+1][now]:
            now+=1

        if now<l1 and now<l2:
            ca, cb = tn(arr[i][now]), tn(arr[i + 1][now])
            gp[ca].append(cb)
        else:
            if l1>l2: tag = False
    res = []
    vis = [0]*(26)

    def dfs(node):
        vis[node] = 1
        nonlocal tag
        for nex in gp[node]:
            if vis[nex]==1: tag = False; continue
            dfs(nex)
        vis[node] = 2
        res.append(node)

    for i in range(26):
        if vis[i]==0:
            dfs(i)

    if tag==False:
        print("Impossible")
    else:
        print("".join([chr(ord('a')+i) for i in res[::-1]]))

if __name__ == "__main__":
    main()


import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../../input.txt')
# sys.stdin = f

def tn(c): return ord(c)-ord('a')

def main():
    n = N()
    arr = [input() for _ in range(n)]
    gp = [[] for _ in range(26)]
    res = []
    tag = True
    for i in range(n-1):
        now = 0
        l1, l2 = len(arr[i]), len(arr[i+1])
        while now<l1 and now<l2 and arr[i][now]==arr[i+1][now]:
            now+=1
        if now<l1 and now<l2:
            ca, cb = tn(arr[i][now]), tn(arr[i + 1][now])
            if ca in gp[cb]: tag = False; break
            gp[ca].append(cb)

    res = []
    vis = [0]*(26)
    def dfs(node):
        vis[node] = 1

        for nex in gp[node]:
            if vis[nex]==1: continue
            dfs(nex)

        res.append(node)

    for i in range(26):
        if vis[i]==0:
            dfs(i)

    if tag==False:
        print("Impossible")
    else:
        print("".join([chr(ord('a')+i) for i in res[::-1]]))

if __name__ == "__main__":
    main()


import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
f = open('../../input.txt')
sys.stdin = f

def tn(c): return ord(c)-ord('a')

def main():
    n = N()
    arr = [input() for _ in range(n)]
    gp = [[] for _ in range(26)]
    res = []
    tag = True
    for i in range(n-1):
        now = 0
        l1, l2 = len(arr[i]), len(arr[i+1])
        while now<l1 and now<l2 and arr[i][now]==arr[i+1][now]:
            now+=1
        if now<l1 and now<l2:
            ca, cb = tn(arr[i][now]), tn(arr[i + 1][now])
            if ca in gp[cb]: tag = False; break
            gp[ca].append(cb)

    res = []
    vis = [0]*(26)
    def dfs(node):
        vis[node] = 1

        for nex in gp[node]:
            if vis[nex]==1: continue
            dfs(nex)

        res.append(node)

    for i in range(26):
        if vis[i]==0:
            dfs(i)

    if tag==False:
        print("Impossible")
    else:
        print("".join([chr(ord('a')+i) for i in res[::-1]]))

if __name__ == "__main__":
    main()


import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../../input.txt')
# sys.stdin = f

def tn(c): return ord(c)-ord('a')

def main():
    n = N()
    arr = [input() for _ in range(n)]
    gp = [[] for _ in range(26)]
    res = []
    tag = True
    for i in range(n-1):
        now = 0
        l1, l2 = len(arr[i]), len(arr[i+1])
        while now<l1 and now<l2 and arr[i][now]==arr[i+1][now]:
            now+=1

        if now<l1 and now<l2:
            ca, cb = tn(arr[i][now]), tn(arr[i + 1][now])
            if ca in gp[cb]: tag = False; break
            gp[ca].append(cb)
        else:
            if l1>l2: tag = False
    res = []
    vis = [0]*(26)
    rtag = False
    def dfs(node, root):
        vis[node] = 1
        nonlocal rtag
        for nex in gp[node]:
            if nex==root: rtag = True
            if vis[nex]==1: continue
            dfs(nex, root)

        res.append(node)

    for i in range(26):
        if vis[i]==0:
            dfs(i, i)
            if rtag: break

    if tag==False or rtag:
        print("Impossible")
    else:
        print("".join([chr(ord('a')+i) for i in res[::-1]]))

if __name__ == "__main__":
    main()


import os
import sys
from io import BytesIO, IOBase
# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------------------

from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def comb(n, m): return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0
def perm(n, m): return factorial(n) // (factorial(n - m)) if n >= m else 0
def mdis(x1, y1, x2, y2): return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

# ------------------------------
# f = open('../../input.txt')
# sys.stdin = f

def tn(c): return ord(c)-ord('a')

def main():
    n = N()
    arr = [input() for _ in range(n)]
    gp = [[] for _ in range(26)]
    res = []
    tag = True
    for i in range(n-1):
        now = 0
        l1, l2 = len(arr[i]), len(arr[i+1])
        while now<l1 and now<l2 and arr[i][now]==arr[i+1][now]:
            now+=1
        if now<l1 and now<l2:
            ca, cb = tn(arr[i][now]), tn(arr[i + 1][now])
            if ca in gp[cb]: tag = False; break
            gp[ca].append(cb)

    res = []
    vis = [0]*(26)
    rtag = False
    def dfs(node, root):
        vis[node] = 1
        nonlocal rtag
        for nex in gp[node]:
            if nex==root: rtag = True
            if vis[nex]==1: continue
            dfs(nex, root)

        res.append(node)

    for i in range(26):
        if vis[i]==0:
            dfs(i, i)
            if rtag: break

    if tag==False or rtag:
        print("Impossible")
    else:
        print("".join([chr(ord('a')+i) for i in res[::-1]]))

if __name__ == "__main__":
    main()


def main():
	imp = False
	nodes = {}
	for i in "abcdefghijklmnopqrstuvwxyz":
	    nodes[i] = set()

	n = int(input())
	prev = None
	for i in range(n):
	    name = input()
	    if prev:
	        for x, y in zip(name, prev):
	            if x != y:
	                nodes[x].add(y)
	                break
	        else:
	            if prev > name:
	                imp = True
	                break
	    prev = name

	q = []
	r = []
	for i in "abcdefghijklmnopqrstuvwxyz":
	    if not nodes[i]:
	        q.append(i)
	    else:
	        r.append(i)

	l = []
	while q:
	    e = q.pop()
	    l.append(e)
	    for i in r[:]:
	        if e in nodes[i]:
	            nodes[i].remove(e)
	            if not nodes[i]:
	                q.append(i)
	                r.remove(i)

	if r or imp:
	    print("Impossible")
	else:
	    print("".join(l))
if __name__ == '__main__':
	main()


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 500;
const int maxx = 330;

ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll fun(ll p, ll k)
{
	ll total = 0;
	while (p > N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (ll i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));
	for (int i = 1; i < 325; i++)
	{
		for (int j = N; j >= 1; j--)
		{
			if (j + Array[j] + 1 > N)dp[i][j] = 1;
			else dp[i][j] = 1 + dp[i][j + Array[j] + i];
		}
	}
	ll T;
	cin >> T;
	while (T--)
	{
		ll p, k;
		cin >> p >> k;
		ll total;
		if (k >= 325)
		{
			total = fun(p, k);
		}
		else
		{
			total = dp[k][p];
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 500;
const int maxx = 230;

ll N;
ll Array[maxn];
ll dp[maxx][maxn];

ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}

ll dfs2(ll p,ll k)
{
	ll total = 0;
	while (p <= N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (ll i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));
	for (int i = 1; i < 225; i++)
	{
		for (int k = N + 1; k <= N + 3000;k++)
			dp[i][k] = 0;
	}
	for (int i = 1; i < 225; i++)
	{
		for (int k = N; k >= 1; k--)
		{
			dp[i][k] = 1 + dp[i][k + i + Array[k]];
		}
	}
	ll T;
	cin >> T;
	while (T--)
	{
		ll p, k;
		cin >> p >> k;
		ll total;
		if (k >= 225)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const int maxx = 330;
ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}
ll dfs2(ll p,ll k)
{
	int total = 0;
	while (p <= N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (int i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));

	int T;
	cin >> T;
	while (T--)
	{
		int p, k;
		cin >> p >> k;
		int total = 0;
		if (k >= 320)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const int maxx = 330;
ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}
ll dfs2(ll p,ll k)
{
	int total = 1;
	while (p > N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (int i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));

	int T;
	cin >> T;
	while (T--)
	{
		int p, k;
		cin >> p >> k;
		int total = 0;
		if (k >= 320)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 500;
const int maxx = 230;

ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll fun(ll p, ll k)
{
	ll total = 0;
	while (p <= N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (ll i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));
	for (int i = 1; i < 225; i++)
	{
		for (int j = N; j >= 1; j--)
		{
			if (j + Array[j] + i > N)dp[i][j] = 1;
			else dp[i][j] = 1 + dp[i][j + Array[j] + i];
		}
	}
	ll T;
	cin >> T;
	while (T--)
	{
		ll p, k;
		cin >> p >> k;
		ll total;
		if (k >= 225)
		{
			total = fun(p, k);
		}
		else
		{
			total = dp[k][p];
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const int maxx = 230;

ll N;
ll Array[maxn];
ll dp[maxx][maxn];

ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}
ll dfs2(ll p,ll k)
{
	ll total = 0;
	while (p <= N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (ll i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));

	ll T;
	cin >> T;
	while (T--)
	{
		ll p, k;
		cin >> p >> k;
		ll total;
		if (k >= 225)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const int maxx = 330;
ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}
ll dfs2(ll p,ll k)
{
	int total = 0;
	while (p > N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (int i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));
	for (int i = 1; i < 320; i++)
	{

	}
	int T;
	cin >> T;
	while (T--)
	{
		int p, k;
		cin >> p >> k;
		int total = 0;
		if (k >= 320)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const int maxx = 330;
ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}
ll dfs2(ll p,ll k)
{
	int total = 0;
	while (p > N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (int i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));

	int T;
	cin >> T;
	while (T--)
	{
		int p, k;
		cin >> p >> k;
		int total = 0;
		if (k >= 0)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 500;
const int maxx = 230;

ll N;
ll Array[maxn];
ll dp[maxx][maxn];
ll fun(ll p, ll k)
{
	ll total = 0;
	while (p <= N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (ll i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));
	for (int i = 1; i < 225; i++)
	{
		for (int j = N; j >= 1; j--)
		{
			if (j + Array[j] + 1 > N)dp[i][j] = 1;
			else dp[i][j] = 1 + dp[i][j + Array[j] + i];
		}
	}
	ll T;
	cin >> T;
	while (T--)
	{
		ll p, k;
		cin >> p >> k;
		ll total;
		if (k >= 225)
		{
			total = fun(p, k);
		}
		else
		{
			total = dp[k][p];
		}
		cout << total << endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const int maxx = 230;

ll N;
ll Array[maxn];
ll dp[maxx][maxn];

ll dfs1(ll p,ll k)
{
	if (dp[k][p] != -1)
	{
		return dp[k][p];
	}
	if (p > N)
	{
		return dp[k][p] = 0;
	}
	else
	{
		return dp[k][p] = 1 + dfs1(p + Array[p] + k, k);
	}
}
ll dfs2(ll p,ll k)
{
	ll total = 0;
	while (p <= N)
	{
		total++;
		p += Array[p] + k;
	}
	return total;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> N;
	for (ll i = 1; i <= N; i++)
		cin >> Array[i];
	memset(dp, -1, sizeof(dp));

	ll T;
	cin >> T;
	while (T--)
	{
		ll p, k;
		cin >> p >> k;
		ll total = 0;
		if (k >= 220)
		{
			total = dfs2(p, k);
		}
		else
		{
			total = dfs1(p, k);
		}
		cout << total << endl;
	}
	return 0;
}


// Tal vez si pase :'v

#include <bits/stdc++.h>

using namespace std;

const int MAX_POS = 1e4, MAX_K = 1e3, MAX_N = 1e5 + 10;

int n, a[MAX_N];
int memo[MAX_POS][MAX_K];

int BF (int p, int k) {
  int cnt = 0;
  while (p <= n) p = p + a[p] + k, cnt++;
  return cnt;
}

int dp (int p, int k) {
  if (p > n) return 0;
  if (p >= MAX_POS or k >= MAX_K) return BF(p, k);
  int& ret = memo[p][k];
  if (~ret) return ret;
  return ret = 1 + dp(p + a[p] + k, k);
}

void pre () {
  memset(memo, -1, sizeof memo);
  for (int p = 1; p < MAX_POS; p++) for (int k = 1; k < MAX_POS; k++) dp(p, k);
}

int main () {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  pre();
  int q;
  scanf("%d", &q);
  while (q--) {
    int p, k;
    scanf("%d %d", &p, &k);
    if (p < MAX_POS and k < MAX_K) printf("%d\n", memo[p][k]);
    else printf("%d\n", BF(p, k));
  }
  return (0);
}


// Tal vez si pase :'v

#include <bits/stdc++.h>

using namespace std;

const int MAX_POS = 1e3, MAX_K = 1e3, MAX_N = 1e5 + 10;

int n, a[MAX_N];
int memo[MAX_POS][MAX_K];

int BF (int p, int k) {
  int cnt = 0;
  while (p <= n) p = p + a[p] + k, cnt++;
  return cnt;
}

int dp (int p, int k) {
  if (p > n) return 0;
  if (p >= MAX_POS or k >= MAX_K) return BF(p, k);
  int& ret = memo[p][k];
  if (~ret) return ret;
  return ret = 1 + dp(p + a[p] + k, k);
}

void pre () {
  memset(memo, -1, sizeof memo);
  for (int p = 1; p < MAX_POS; p++) for (int k = 1; k < MAX_POS; k++) dp(p, k);
}

int main () {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  pre();
  int q;
  scanf("%d", &q);
  while (q--) {
    int p, k;
    scanf("%d %d", &p, &k);
    if (p < MAX_POS and k < MAX_K) printf("%d\n", memo[p][k]);
    else printf("%d\n", BF(p, k));
  }
  return (0);
}


// Tal vez si pase :'v

#include <bits/stdc++.h>

using namespace std;

const int MAX_POS = 4.3e4, MAX_K = 1e3, MAX_N = 1e5 + 10;

int n, a[MAX_N];
int memo[MAX_POS][MAX_K];

int BF (int p, int k) {
  int cnt = 0;
  while (p <= n) p = p + a[p] + k, cnt++;
  return cnt;
}

int dp (int p, int k) {
  if (p > n) return 0;
  if (p >= MAX_POS or k >= MAX_K) return BF(p, k);
  int& ret = memo[p][k];
  if (~ret) return ret;
  return ret = 1 + dp(p + a[p] + k, k);
}

void pre () {
  memset(memo, -1, sizeof memo);
  for (int p = 1; p < MAX_POS; p++) for (int k = 1; k < MAX_POS; k++) dp(p, k);
}

int main () {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  pre();
  int q;
  scanf("%d", &q);
  while (q--) {
    int p, k;
    scanf("%d %d", &p, &k);
    if (p < MAX_POS and k < MAX_K) printf("%d\n", memo[p][k]);
    else printf("%d\n", BF(p, k));
  }
  return (0);
}


// Tal vez si pase :'v

#include <bits/stdc++.h>

using namespace std;

const int MAX_POS = 3e4, MAX_K = 1e3, MAX_N = 1e5 + 10;

int n, a[MAX_N];
int memo[MAX_POS][MAX_K];

int BF (int p, int k) {
  int cnt = 0;
  while (p <= n) p = p + a[p] + k, cnt++;
  return cnt;
}

int dp (int p, int k) {
  if (p > n) return 0;
  if (p >= MAX_POS or k >= MAX_K) return BF(p, k);
  int& ret = memo[p][k];
  if (~ret) return ret;
  return ret = 1 + dp(p + a[p] + k, k);
}

void pre () {
  memset(memo, -1, sizeof memo);
  for (int p = 1; p < MAX_POS; p++) for (int k = 1; k < MAX_POS; k++) dp(p, k);
}

int main () {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  pre();
  int q;
  scanf("%d", &q);
  while (q--) {
    int p, k;
    scanf("%d %d", &p, &k);
    if (p < MAX_POS and k < MAX_K) printf("%d\n", memo[p][k]);
    else printf("%d\n", BF(p, k));
  }
  return (0);
}


// Tal vez si pase :'v

#include <bits/stdc++.h>

using namespace std;

const int MAX_POS = 4.5e4, MAX_K = 1e3, MAX_N = 1e5 + 10;

int n, a[MAX_N];
int memo[MAX_POS][MAX_K];

int BF (int p, int k) {
  int cnt = 0;
  while (p <= n) p = p + a[p] + k, cnt++;
  return cnt;
}

int dp (int p, int k) {
  if (p > n) return 0;
  if (p >= MAX_POS or k >= MAX_K) return BF(p, k);
  int& ret = memo[p][k];
  if (~ret) return ret;
  return ret = 1 + dp(p + a[p] + k, k);
}

void pre () {
  memset(memo, -1, sizeof memo);
  for (int p = 1; p < MAX_POS; p++) for (int k = 1; k < MAX_POS; k++) dp(p, k);
}

int main () {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  pre();
  int q;
  scanf("%d", &q);
  while (q--) {
    int p, k;
    scanf("%d %d", &p, &k);
    if (p < MAX_POS and k < MAX_K) printf("%d\n", memo[p][k]);
    else printf("%d\n", BF(p, k));
  }
  return (0);
}