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 AlphabeticalOrder {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    public static long MOD = (long) (1e9 + 7);


    public static void solve(InputReader sc, PrintWriter pw) {

        int n = sc.nextInt();

        String[] words = new String[n];

        for (int i = 0; i < n; i++) {
            words[i] = sc.next();
        }

        findAlphabeticalOrder(words, n, pw);
    }

    private static void findAlphabeticalOrder(String[] words, int n, PrintWriter pw) {

        if (n == 1) {
            pw.println("abcdefghijklmnopqrstuvwxyz");
            return;
        }


        Graph graph = new DirectedGraph(26);

        int[] inDegree = new int[26];

        for (int i = 0; i < n; i++) {

            for (int j = i + 1; j < n; j++) {
                String word1 = words[i];
                String word2 = words[j];

                int diff = first(word1, word2);

                if (diff == -1) {
                    if (word1.length() > word2.length()) {
                        pw.println("Impossible");
                        return;
                    }
//                    continue;
                } else {
                    if (word1.charAt(diff) != word2.charAt(diff)) {
                        graph.addEdge(word1.charAt(diff) - 'a', word2.charAt(diff) - 'a');
                        inDegree[word2.charAt(diff) - 'a']++;
                    }
                }

            }
        }

        boolean[] visited = new boolean[26];
        Queue<Integer> q = new LinkedList();

        for (int i = 0; i < 26; i++) {
            if (inDegree[i] == 0) {
                q.add(i);
                visited[i] = true;
            }
        }

        StringBuilder res = new StringBuilder();

        int vertex = 0;

        while (q.isEmpty() == false) {

            int node = q.poll();
            res.append((char) (node + 'a'));

            for (int neigh : graph.adjList.get(node)) {
                if (visited[neigh] == false) {
                    inDegree[neigh]--;

                    if (inDegree[neigh] == 0) {
                        q.add(neigh);
                        visited[neigh] = true;
                    }
                }
            }

            vertex++;
        }

        if (vertex != 26) {
            pw.println("Impossible");
            return;
        }

        System.out.println(res);
        ;

    }

    public static int first(String c, String d) {
        for (int i = 0; i < Math.min(c.length(), d.length()); i++) {
            if (c.charAt(i) != d.charAt(i)) return i;
        }
        return -1;
    }

    public static abstract class Graph {
        int nodes;
        List<List<Integer>> adjList;

        public Graph(int nodes) {
            this.nodes = nodes;
            this.adjList = new ArrayList<>(nodes);

            for (int i = 0; i < nodes; i++)
                this.adjList.add(new ArrayList<>());
        }

        abstract void addEdge(int node1, int node2);

        void printGraph() {
            for (int i = 0; i < nodes; i++)
                System.out.println(i + " => " + adjList.get(i));
        }

    }

    public static class DirectedGraph extends Graph {

        public DirectedGraph(int nodes) {
            super(nodes);
        }

        @Override
        void addEdge(int node1, int node2) {
            adjList.get(node1).add(node2);
        }
    }

    public static class UnDirectedGraph extends Graph {

        public UnDirectedGraph(int nodes) {
            super(nodes);
        }

        @Override
        void addEdge(int node1, int node2) {
            adjList.get(node1).add(node2);
            adjList.get(node2).add(node1);
        }
    }

    static long add(long a, long b, long m) {
        return (((a % m) + (b % m)) % m);
    }

    static long subtract(long a, long b, long m) {
        return (((a % m) - (b % m) + m) % m);
    }

    static long multiply(long a, long b, long mod) {
        return (((a % mod) * (b % mod)) % mod);
    }

    static long divide(long a, long b, long m) {
        long temp = modInverse(b, m);
        return multiply(a, temp, m);
    }

    static String reverse(String s) {
        return (new StringBuilder(s)).reverse().toString();
    }

    static void inputArray(int[] nums, int n, InputReader sc) {
        for (int i = 0; i < n; i++)
            nums[i] = sc.nextInt();
    }

    static void sieveOfEratosthenes(int n, int factors[]) {
        factors[1] = 1;
        for (int p = 2; p * p <= n; p++) {
            if (factors[p] == 0) {
                factors[p] = p;
                for (int i = p * p; i <= n; i += p)
                    factors[i] = p;
            }
        }
    }

    static void sort(int ar[]) {
        int n = ar.length;
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++)
            a.add(ar[i]);
        Collections.sort(a);
        for (int i = 0; i < n; i++)
            ar[i] = a.get(i);
    }

    static void sort1(long ar[]) {
        int n = ar.length;
        ArrayList<Long> a = new ArrayList<>();
        for (int i = 0; i < n; i++)
            a.add(ar[i]);
        Collections.sort(a);
        for (int i = 0; i < n; i++)
            ar[i] = a.get(i);
    }

    static long ncr(long n, long r, long mod) {
        if (r == 0)
            return 1;
        long val = ncr(n - 1, r - 1, mod);
        val = (n * val) % mod;
        val = (val * modInverse(r, mod)) % mod;
        return val;
    }


    static long lcm(int a, int b) {
        return a * b / gcd(a, b);
    }

    static boolean isPrime(long n) {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;
        if (n % 2 == 0 || n % 3 == 0)
            return false;
        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;
        return true;
    }

    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static long fast_pow(long base, long n, long M) {
        if (n == 0)
            return 1;
        if (n == 1)
            return base % M;
        long halfn = fast_pow(base, n / 2, M);
        if (n % 2 == 0)
            return (halfn * halfn) % M;
        else
            return (((halfn * halfn) % M) * base) % M;
    }

    static long modInverse(long n, long M) {
        return fast_pow(n, M - 2, M);
    }

    static class Pair1 {
        long a;
        long b;

        Pair1(long a, long b) {
            this.a = a;
            this.b = b;
        }
    }

    static class Pair implements Comparable<Pair> {
        int a;
        int b;
        // int i;

        Pair(int a, int b) {
            this.a = a;
            this.b = b;
            // this.i = i;
        }

        public int compareTo(Pair p) {
            if (a != p.a)
                return a - p.a;
            return b - p.b;
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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