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:
//Problem Name FOX AND NAMES

import java.io.*;
import java.util.*;
import java.math.*;


 

  public class A {
	 
	
   InputStream is;
   static PrintWriter out;
   static int ind[];
   static int par[];
   static ArrayList<Integer> topo;

   static class pair
   {
	   int idx;
	   int val;
	   pair(int i,int v)
	   {
		   idx=i;
		   val=v;
	   }
   }
	 
   	static boolean isCyclic(LinkedList<Integer> l[],int u)
	{
		par[u]=1;
		for(int v:l[u])
		{
			if(par[v]==1)
				return true;
			
			if(par[v]==0 && isCyclic(l,v))
				return true;
		}
		
		par[u]=2;
		return false;
	}
	 
	 static void kahn(LinkedList<Integer> l[],int n)
   {
	   PriorityQueue<Integer> q=new PriorityQueue<Integer>();
	   for(int i=0;i<n;i++)
		   if(ind[i]==0)
			   q.add(i);
	   
	   
	   while(q.size()!=0)
	   {
		   int u=q.poll();
		   topo.add(u);
		   
		   for(int v:l[u])
		   {
			   ind[v]--;
			   if(ind[v]==0)
			   {
				   q.add(v);
			   }
		   }
		   
	   }
	   
	   
	   
   }
	 
  
   void solve()
   {
	   int n=ni();
	   
	   String s[]=new String[n];
	   String ss[]=new String[n];
	   
	   for(int i=0;i<n;i++){
	   s[i]=ns();ss[i]=s[i];}
	   
	   Arrays.sort(ss);
	   
	   int nn=26;
	   ind=new int[nn];
	   LinkedList<Integer> l[]=new LinkedList[nn];
	   for(int i=0;i<nn;i++)
		   l[i]=new LinkedList<Integer>();
	   
	   int kotlin=0;
	   for(int i=0;i<n-1;i++)
	   {
		   for(int j=i+1;j<n;j++)
		   {
			   char cha[]=s[i].toCharArray();
			   char chb[]=s[j].toCharArray();
			   int l1=cha.length;
			   int l2=chb.length;
			   int p1=0,p2=0;
			   
			   while(p1<l1 && p2<l2)
			   {
				   if(cha[p1]==chb[p2]){
					   p1++;
				   	   p2++;}
				   else
				   {
					   int c1=(int)(cha[p1]-'a');
					   int c2=(int)(chb[p2]-'a');
					   l[c1].add(c2);
					   ind[c2]++;
					   //out.println(c1+" sf "+c2);
					   kotlin=1;
					   break;
				   }
			   }
			   
			  
		   }
	   }
	   
	   	par=new int[nn];
		topo=new ArrayList<Integer>();
		int cycle=0;
		
		for(int i=0;i<nn;i++)
		{
			if(par[i]==0)
			{
				if(isCyclic(l,i))
				{
					cycle=1;
					break;
				}	
			}
		}
		
	    if(kotlin==0){
	   	for(int i=0;i<n;i++)
		{
			if(s[i].compareTo(ss[i])!=0)
			{
				cycle=1;
				break;
			}
		}
		}
	   
	   
	   
		if(cycle==1)
			out.print("Impossible");
		else
		{
			topo=new ArrayList<Integer>();
			kahn(l,nn);
			for(int i=0;i<nn;i++){
				char kohli=(char)(topo.get(i)+97);
				out.print(kohli);
			}
		}
	   
	   
	   
	   //bcdefghijklmnopqrsatuvwxyz
	   //bcdefghijklmnopqrsatuvwxyz
	   
	   //aghjlnopefikdmbcqrstuvwxyz
	   //aghjlnopefikdmbcqrstuvwxyz
	   
	   
	   
   }
		  
	   
	   
	   
	      
		  
		  
	  	 
		  
		
	  
   
	
	

	
	
	
 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 

	
    //---------- I/O Template ----------
    
    public static void main(String[] args) { new A().run(); }
    void run() { 
        is = System.in; 
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }
    
    byte input[] = new byte[1024];
    int len = 0, ptr = 0;
    
    int readByte() { 
        if(ptr >= len) { ptr = 0; 
            try { len = is.read(input); } 
            catch(IOException e) { throw new InputMismatchException(); } 
            if(len <= 0) { return -1; } 
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() { 
        int b = readByte(); 
        while(b != -1 && isSpaceChar(b)) { b = readByte(); } 
        return b;
    }
    
    char nc() { return (char)skip(); }
    String ns() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    String nLine() { 
        int b = skip(); 
        StringBuilder sb = new StringBuilder(); 
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); } 
        return sb.toString();
    }
    int ni() { 
        int n = 0, b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        if(b == -1) { return -1; }  //no input 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
    long nl() { 
        long n = 0L;    int b = readByte(); 
        boolean minus = false; 
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); } 
        if(b == '-') { minus = true; b = readByte(); } 
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); } 
        return minus ? -n : n;
    }
 
    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) { 
        int a[] = new int[n]; 
        for(int i = 0; i < n; i++) { a[i] = ni(); } 
        return a;
    }
    char[] ns(int n) { 
        char c[] = new char[n]; 
        int i, b = skip(); 
        for(i = 0; i < n; i++) { 
            if(isSpaceChar(b)) { break; } 
            c[i] = (char)b; b = readByte(); 
        } return i == n ? c : Arrays.copyOf(c,i);
    }
	static void pa(int a[])
	{
		for(int i=0;i<a.length;i++)
		out.print(a[i]+" ");
		out.println();
	}
	static void pa(long a[])
	{
		for(int i=0;i<a.length;i++)
		out.print(a[i]+" ");
		out.println();
	}
	
}