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.*;
import java.util.*;

public class Solution{
    InputStream is;
    static PrintWriter out;
    String INPUT = "";
    static long mod = (long)1e9+7L;
    
    public void solve(){
        int n = ni();
        String[] a = new String[n];
        for(int i=0; i<n; i++){
            a[i] = ns();
        }

        Graph g = new Graph(26);

        for(int i=0; i<n-1; i++){
            for(int j = i+1; j<n; j++){
                int l1 = a[i].length(), l2 = a[j].length();
                int k = 0;
                for(k=0; k<l1 && k<l2; k++){
                    if(a[i].charAt(k) != a[j].charAt(k)){
                        g.addEdge(a[j].charAt(k)-(int)'a', a[i].charAt(k)-(int)'a');
                        break;
                    }
                }
                if(k == l2 && k < l1){
                    out.println("Impossible");
                    return;
                }
            }
        }
//for(int i=0; i<26; i++){
//    out.println(g.adj[i]);
//}
//out.println(g.checkCycle());
        if(g.checkCycle()){
            out.println("Impossible");
        }
        else{
            ArrayList<Integer> res = g.topologicalSort();
            for(int i=0; i<res.size(); i++){
                out.print((char)(res.get(i)+(int)'a'));
            }
            out.println();
        }
    }

    static class Graph{//made for 0 indexed graph.
        int V;
        ArrayList<Pair> adj[];
        public Graph(int v){
            V=v;
            adj=new ArrayList[v];
            for(int i=0;i<V;i++)adj[i]=new ArrayList<Pair>();
        }
        void addEdge(int v1,int v2){
            adj[v1].add(new Pair(v2,0));
            //adj[v2].add(new Pair(v1,0));
        }
        void addEdge(int v1,int v2,long w){
            adj[v1].add(new Pair(v2,w));
            //adj[v2].add(new Pair(v1,w));    
        }

        ArrayList<Integer> topSort;
        boolean vis[];
        void topologicalSortUtil(int i){
            vis[i]=true;
            for(Pair p:adj[i]){
                if(vis[i(p.fs)]==false){
                    topologicalSortUtil(i(p.fs));
                }
            }
            topSort.add(i);
        }
        ArrayList<Integer> topologicalSort(){
            topSort=new ArrayList<Integer>();
            vis=new boolean[V];
            for(int i=0;i<V;i++){//if graph is 1 indexed then change value of i=0 to i=1;
                if(vis[i]==false)
                    topologicalSortUtil(i);
            }
            return topSort;
        }

        boolean recStack[];
        boolean checkCycle(){
            vis = new boolean[V];
            recStack = new boolean[V];
            for(int i=0; i<V; i++){
                if(!vis[i] && containsCycle(i)){
                    return true;
                }
            }
            return false;
        }
        boolean containsCycle(int root){
            vis[root] = true;
            recStack[root] = true;

            for(Pair child : adj[root]){
                if(recStack[i(child.fs)]){
                    return true;
                }

                if( !vis[i(child.fs)] && containsCycle(i(child.fs)) ) {
                    return true;
                }
            }
            recStack[root] = false;

            return false;
        }
    }

    void run(){
        is = new DataInputStream(System.in);
        out = new PrintWriter(System.out);
        int t=1;while(t-->0)solve();
        out.flush();
    }
    public static void main(String[] args)throws Exception{new Solution().run();}
    long mod(long v, long m){if(v<0){long q=(Math.abs(v)+m-1L)/m;v=v+q*m;}return v%m;}
    long mod(long v){if(v<0){long q=(Math.abs(v)+mod-1L)/mod;v=v+q*mod;}return v%mod;}
    //Fast I/O code is copied from uwi code.
    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;
    private int readByte(){
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }
    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }
    private String ns(){
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    private char[] ns(int n){
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }
    private char[][] nm(int n, int m){
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }
    private int[] na(int n){
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }
    private int ni(){
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    private long nl(){
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }        
        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    static  int i(long x){return (int)Math.round(x);}
    static class Pair implements Comparable<Pair>{
        long fs,sc;
        Pair(long a,long b){
            fs=a;sc=b;
        }
        public int compareTo(Pair p){
            if(this.fs>p.fs)return 1;
            else if(this.fs<p.fs)return -1;
            else{
                return i(this.sc-p.sc);
            }
            //return i(this.sc-p.sc);
        }
        public String toString(){
            return "("+fs+","+sc+")";
        }    
    }
    
}