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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;

public class Code {
    static boolean skip = false;
    public static void main(String[] args) throws IOException {
        // Use the Scanner class
        MyScanner sc = new MyScanner();
        //FastScanner sc = new FastScanner(System.in);
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt();
        String[] words = new String[n];
        for (int i = 0; i < n; ++i) {
            words[i] = sc.nextLine();
        }
        Graph g = new Graph();

        for (int i = 0; i < n -1; ++i) {
            String w1 = words[i];
            String w2 = words[i+1];
            if (!are_lexicographically_ordered(w1, w2)) {
                int idx = get_diff_index(w1, w2);
                if (idx == -1) {
                    System.out.println("Impossible");
                    return;
                }

                int parent_id = w1.charAt(idx) - 'a';
                int child_id = w2.charAt(idx) - 'a';
                g.adj.get(parent_id).add(child_id);
            }
        }

        StringBuilder sb = new StringBuilder();
        Stack<Integer> s = g.top_sort();
        if (s == null) {
            System.out.println("Impossible");
            return;
        }
        while (!s.isEmpty()) {
            int c = s.pop() + 'a';
            sb.append((char) c);
        }
        System.out.println(sb.toString());
    }

    static boolean are_lexicographically_ordered(String w1, String w2) {
        if (w2.startsWith(w1) && w1.length() <= w2.length()) {
            return true;
        }
        return false;
    }

    static int get_diff_index(String w1, String w2) {
        if (w1.startsWith(w2) && w1.length() > w2.length()) {
            return -1;
        }

        for (int i = 0; i < Math.min(w1.length(), w2.length()); ++i) {
            if(w1.charAt(i) != w2.charAt(i)) {
                return i;
            }
        }

        return -1;
    }


    static class Graph {
        final int NOT_VISITED = 0;
        final int ON_CALL_STACK = 1;
        final int VISITED = 2;

        List<Set<Integer>> adj;
        int n = 26;

        public Graph() {
            adj = new ArrayList<>(n);
            for (int i = 0; i < n; ++i) {
                adj.add(new HashSet<>());
            }
        }

        public Stack<Integer> top_sort() {
            int[] state = new int[28];
            Stack<Integer> sort_stack = new Stack<>();
            boolean  run = true;
            for (int i = 0; i < n; ++i) {
                if (state[i] == NOT_VISITED) {
                    run = run && dfs(i, state, sort_stack);
                    if (!run) {
                        return null;
                    }
                }
            }
            return sort_stack;
        }

        private boolean dfs(int root, int[] state, Stack<Integer> sort_stack) {

            // LOOP detection
            if (state[root] == ON_CALL_STACK) {
                return false;
            }

            state[root] = ON_CALL_STACK;

            for (int ch : adj.get(root)) {
                if (state[ch] != VISITED) {
                    if (!dfs(ch, state, sort_stack)) {
                        return false;
                    }
                }
            }

            state[root] = VISITED;
            sort_stack.push(root);
            return true;
        }
    }




    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
       BufferedReader br;
       StringTokenizer st;

       public MyScanner() {
          br = new BufferedReader(new InputStreamReader(System.in));
       }

       String next() {
           while (st == null || !st.hasMoreElements()) {
               try {
                   st = new StringTokenizer(br.readLine());
               } catch (IOException e) {
                   e.printStackTrace();
               }
           }
           return st.nextToken();
       }

       int nextInt() {
           return Integer.parseInt(next());
       }

       long nextLong() {
           return Long.parseLong(next());
       }

       double nextDouble() {
           return Double.parseDouble(next());
       }

       String nextLine(){
           String str = "";
       try {
          str = br.readLine();
       } catch (IOException e) {
          e.printStackTrace();
       }
       return str;
       }

    }

    static public class FastScanner {

        static final int DEFAULT_BUFF = 10240, EOF = -1, INT_MIN = 48, INT_MAX = 57;
        static final byte NEG = 45;
        static final int[] ints = new int[58];

        static {
            int value = 0;
            for (int i = 48; i < 58; i++) {
                ints[i] = value++;
            }
        }

        InputStream stream;

        byte[] buff;
        int buffPtr;

        public FastScanner(InputStream stream) {
            this.stream = stream;
            this.buff = new byte[DEFAULT_BUFF];
            this.buffPtr = -1;
        }

        public int nextInt() throws IOException {
            int val = 0;
            int sign = readNonDigits();
            while (isDigit(buff[buffPtr]) && buff[buffPtr] != EOF) {
                val = (val << 3) + (val << 1) + ints[buff[buffPtr]];
                buffPtr++;
                if (buffPtr == buff.length) {
                    updateBuff();
                }
            }
            return val*sign;
        }

        private int readNonDigits() throws IOException {
            if (buffPtr == -1 || buffPtr == buff.length) {
                updateBuff();
            }
            if (buff[buffPtr] == EOF) {
                throw new IOException("End of stream reached");
            }
            int signByte = -1;
            while (!isDigit(buff[buffPtr])) {
                signByte = buff[buffPtr];
                buffPtr++;
                if (buffPtr >= buff.length) {
                    updateBuff();
                }
                if (buff[buffPtr] == EOF) {
                    throw new IOException("End of stream reached");
                }
            }
            if(signByte == NEG) return -1;
            return 1;
        }

        public void close() throws IOException {
            stream.close();
        }

        private boolean isDigit(int b) {
            return b >= INT_MIN && b <= INT_MAX;
        }

        private void updateBuff() throws IOException {
            buffPtr = 0;
            stream.read(buff);
        }
    }
}