Problem: Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order. 

After checking some examples, she found out that sometimes it wasn't true. On some papers authors' names weren't sorted in lexicographical order in normal sense. But it was always true that after some modification of the order of letters in alphabet, the order of authors becomes lexicographical!

She wants to know, if there exists an order of letters in Latin alphabet such that the names on the paper she is submitting are following in the lexicographical order. If so, you should find out any such order.

Lexicographical order is defined in following way. When we compare s and t, first we find the leftmost position with differing characters: si ≠ ti. If there is no such position (i. e. s is a prefix of t or vice versa) the shortest string is less. Otherwise, we compare characters si and ti according to their order in alphabet.

Input

The first line contains an integer n (1 ≤ n ≤ 100): number of names.

Each of the following n lines contain one string namei (1 ≤ |namei| ≤ 100), the i-th name. Each name contains only lowercase Latin letters. All names are different.

Output

If there exists such order of letters that the given names are sorted lexicographically, output any such order as a permutation of characters 'a'–'z' (i. e. first output the first letter of the modified alphabet, then the second, and so on).

Otherwise output a single word "Impossible" (without quotes).

Examples

Input

3
rivest
shamir
adleman


Output

bcdefghijklmnopqrsatuvwxyz


Input

10
tourist
petr
wjmzbmr
yeputons
vepifanov
scottwu
oooooooooooooooo
subscriber
rowdark
tankengineer


Output

Impossible


Input

10
petr
egor
endagorion
feferivan
ilovetanyaromanova
kostka
dmitriyh
maratsnowbear
bredorjaguarturnik
cgyforever


Output

aghjlnopefikdmbcqrstuvwxyz


Input

7
car
care
careful
carefully
becarefuldontforgetsomething
otherwiseyouwillbehacked
goodluck


Output

acbdefhijklmnogpqrstuvwxyz

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.*;

public class Main {
	static int n;
    static int m;
    static char[][] a;
    static int[][] t;
    public static void main(String[] args) {
        FasterScanner s = new FasterScanner();
        PrintWriter out=new PrintWriter(System.out);
       
        
        n=s.nextInt();
        a=new char[n][];
        for(int i=0;i<n;i++)
        	a[i]=s.nextLine().toCharArray();
        
        boolean[][] next=new boolean[26][26];
        for(int i=0;i<n;i++)
        {
        	loop:
        	for(int j=i+1;j<n;j++)
        	{
        		for(int k=0;k<Math.min(a[i].length,a[j].length);k++)
        		{
        			if(a[i][k]!=a[j][k])
        			{
        				next[a[i][k]-'a'][a[j][k]-'a']=true;
        				continue loop;
        			}
        		}
        		if(a[i].length>a[j].length)
        		{
        			System.out.println("Impossible");
        			System.exit(0);
        		}
        	}
        }
        List<Integer> graph[] = new ArrayList[26];
        
        for(int i=0;i<26;i++)
        {
        	graph[i]=new ArrayList<>();
        	
        	for(int j=0;j<26;j++)
        		if(next[i][j] && i!=j)
        			graph[i].add(j);
        }
        
//        for(int i=0;i<26;i++)
//        {
//        	System.out.println(i+" ---> "+graph[i]);
//        }
        List<Integer> ans=topologicalSort(graph);
        for(int u:ans)
        	System.out.print((char)(u+'a'));
        System.out.println();
    }
    static boolean b[] = new boolean[26];
    	static void dfs(List<Integer>[] graph, boolean[] used, List<Integer> res, int u) {
//    		System.out.println("u :"+u);
    		used[u] = true;
    		b[u]=true;
    		for (int v : graph[u])
    			if (!used[v])
    			{
    				dfs(graph, used, res, v);
    			}
    			else if (b[v])
    			{
    				System.out.println("Impossible");
    				System.exit(0);
    			}
    		b[u]=false;
    		res.add(u);
    	}

    	public static List<Integer> topologicalSort(List<Integer>[] graph) {
    		int n = graph.length;
    		boolean[] used = new boolean[n];
    		List<Integer> res = new ArrayList<>();
    		for (int i = 0; i < n; i++)
    			if (!used[i])
    			{
//    				System.out.println("NEW START");
    				b=new boolean[26];
    				dfs(graph, used, res, i);
    			}
    		Collections.reverse(res);
    		return res;
    	}

    

    
    static void dfs(int i,int j, int k)
    {
//    	System.out.println(i+" "+j+" "+k);
    	t[i][j]=k;
    	if( j-1>=0 &&a[i][j]==a[i][j-1])
    	{
    		if(t[i][j-1]==-1)
    			dfs(i,j-1,k+1);
    		else if(-t[i][j-1]+t[i][j]>=3)
    		{
    			System.out.println("Yes");
    			System.exit(0);
    		}
    	}
    	if(j+1<m  &&a[i][j]==a[i][j+1])
    	{
    		if(t[i][j+1]==-1)
    			dfs(i,j+1,k+1);
    		else if(-t[i][j+1]+t[i][j]>=3)
    		{
    			System.out.println("Yes");
    			System.exit(0);
    		}
    	}
    	if(i-1>=0 &&a[i][j]==a[i-1][j])
    	{
    		if(t[i-1][j]==-1)
    			dfs(i-1,j,k+1);
    		else if(-t[i-1][j]+t[i][j]>=3)
    		{
    			System.out.println("Yes");
    			System.exit(0);
    		}
    	}
    	if(i+1<n  &&a[i][j]==a[i+1][j])
    	{
    		if(t[i+1][j]==-1)
    			dfs(i+1,j,k+1);
    		else if(-t[i+1][j]+t[i][j]>=3)
    		{
    			System.out.println("Yes");
    			System.exit(0);
    		}
    	}
    }
	public static class st {
	
	    static int n;
	    static int[] t;
	    static int [] pos;
	   
	    static void build(int n2,int[] b) {  // build the tree
	       t=b;
	       n=n2;
	       pos=new int[2*n];
	       for(int i=n;i<2*n;i++)
	       {
	    	   pos[i]=i-n;
	       }
	        for (int i = n - 1; i > 0; --i)
	        {
	        	if(t[pos[i<<1]]>t[pos[i<<1|1]])
	        		pos[i]=pos[i<<1];
	        	else
	        		pos[i]=pos[i<<1|1];
	        }
	    }
	
	    static void modify(int p, int value) {  // set value at position p
	      for (t[p += n] = value; p > 1; p >>= 1) t[p>>1] = Math.max(t[p] , t[p^1]);
	    }
	
	    static int query(int l, int r) {  // sum on interval [l, r)
	      long res=-1;
	      int p=0;
	      for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
	            if ((l&1)!=0) {
	            	if(res<t[pos[l]])
	            	{
	            		res=t[pos[l]];
	            		p=pos[l];
	            	}
	            	l++;
	            }
	            if ((r&1)!=0){
	            	r--;
	            	if(res<t[pos[r]])
	            	{
	            		res=t[pos[r]];
	            		p=pos[r];
	            	}
	            }
	          }
	      return p;
	    }
	}
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
          
        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
      
        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}