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.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.Vector;

public class FoxANDNames {
	
	static int[] pos , parent;
	static String dict = "abcdefghijklmnopqrstuvwxyz";
	static HashMap<Character, Integer> map = new HashMap<>();
	static Vector<Vector<Integer>> ordredLists =  new Vector<>();
	static PriorityQueue<OrderedCharacter> pQ = new PriorityQueue<>();
	static LinkedList<Integer>[] adjsUp;
	
	static class OrderedCharacter implements Comparable<OrderedCharacter> {
		int index , pos ;
		public OrderedCharacter(int ind , int r){
			this.index = ind;
			this.pos = r;
		}
		@Override
		public int compareTo(OrderedCharacter o) {
			return this.pos - o.pos;
		}
	}
	
	static void initialize(String[] words , int[] lengths , int maxLength){
		int n = dict.length();
		pos = new int[n];
		parent = new int[n];
		adjsUp = new LinkedList[n];
		for (int i = 0; i < n; i++) {
			pos[i] = 0;
			map.put(dict.charAt(i), i);
			parent[i] = i;
			adjsUp[i] = new LinkedList<>();
		}
		ordredLists = getOrderedCharacter(words , lengths , maxLength);
	}
	
	static boolean isProbablyPossibleToOrder(String[] words , int[] lengths ){
		for (int i = 1; i < words.length; i++) {
			if(lengths[i-1]>lengths[i] && words[i-1].substring(0, lengths[i]).compareTo(words[i])==0)
				return false;
		}
		return true;
	}
	
	static Vector<Vector<Integer>> getOrderedCharacter(String[] words , int[] lengths , int maxLength){
		Vector<Vector<Integer>> allList =  new Vector<>();
		String ch ;
		for (int i = 0; i < maxLength; i++) {
			for (int j = 0; j < words.length; j++) {
				if(lengths[j]<=i) continue;
				ch = words[j].substring(0,i);
				Vector<Integer> list = new Vector<>();
				list.add(map.get(words[j].charAt(i)));
				int k = j+1;
				while (k < words.length && lengths[k]>i) {
					if(words[k].substring(0, i).compareTo(ch)!=0) break;
					char c = words[k].charAt(i);
					if(list.get(list.size()-1)!=map.get(c)) list.add(map.get(c));
					k++;
				}
				j = k-1;
				allList.add(list);
			}
		}
		return allList;
	}
	
	static boolean isCyclic(int i){
		Vector<Integer> vec = ordredLists.get(i);
		int pj , pj2 , vj , vj2;
		for (int j = 0; j < vec.size()-1; j++) {
			vj = vec.get(j);
			for (int j2 = j+1; j2 < vec.size(); j2++) {
				vj2 = vec.get(j2);
				
				// in this list, pos[vj] < pos[vj2] 
				if( vj==vj2 || ( parent[vj]==parent[vj2] && pos[vj] > pos[vj2] && isAlreadyOrdred_dfs(vj2,vj))) return true;
			}
		}
		return false;
	}
	
	static void dfs(int i , int adj){
		pos[adj] = Math.max(pos[i]+1 , pos[adj]);
		parent[adj] = parent[i];
		for (Integer nextAdj: adjsUp[adj])   dfs(adj,nextAdj);
	}
	
	static void changeParent(int nextParent , int prevParent){
		for (int i = 0; i < parent.length; i++) {
			if(parent[i]==prevParent) parent[i] = nextParent;
		}
	}
	
	static boolean isAlreadyOrdred_dfs(int down , int up){
		for(Integer adj:adjsUp[down]){
			if(adj==up || isAlreadyOrdred_dfs(adj , up)) return true;
		}
		return false;
	}
	
	
	static void changeOrder(int i){
		Vector<Integer> vec = ordredLists.get(i);
		for (int j = 0; j<vec.size()-1 ; j++) {
			if(!adjsUp[vec.get(j)].contains(vec.get(j+1))) adjsUp[vec.get(j)].add(vec.get(j+1));
			changeParent(parent[vec.get(j)], parent[vec.get(j+1)]);
			dfs(vec.get(j) , vec.get(j+1));
		}
	}
	
	static boolean saveOrder(){
		for (int i = 0; i < ordredLists.size(); i++) {
			if(isCyclic(i)) return false;
			changeOrder(i);
		}
		return true;
	}
	
	public static void main(String[] args) throws Exception{
		BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		String[] words = new String[n];
		int[] lengths = new int[n];
		int maxLength = 0;
		for (int i = 0; i < n; i++) {
			st = new StringTokenizer(br.readLine());
			words[i] = st.nextToken();
			lengths[i] = words[i].length();
			maxLength = Math.max(maxLength ,  lengths[i]);
		}
		String out = "";
		if(isProbablyPossibleToOrder(words, lengths)){
			initialize(words , lengths , maxLength);
			
			/*
			 * for (int i = 0; i < ordredLists.size(); i++) {
				System.out.println(ordredLists.get(i));
			}*/
			
			if(saveOrder()){
				for (int i = 0; i < pos.length; i++) {
					pQ.add(new OrderedCharacter(i,pos[i]));
				}
				boolean[] visited = new boolean[pos.length];
				OrderedCharacter oc;
				while(!pQ.isEmpty()){
					oc = pQ.poll();
					int c = oc.index , ps = oc.pos;
					for (int i = 0; i <= c; i++) {
						if(!visited[i] && pos[i]<=ps) {
							out+= dict.charAt(i);
							visited[i] = true;
						}
					}
				}
			}
			else out = "Impossible";
			
			//System.out.println(Arrays.toString(pos));
			//System.out.print(Arrays.toString(dict.toCharArray()));
		}
		else out = "Impossible";
		System.out.println(out);
	}
}