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:
//4 4
//1 4 4
//1 2 2
//2 4 1
//1 3 3

import java.beans.Visibility;
import java.io.IOException;
import java.util.ArrayList;

import javax.swing.text.html.MinimalHTMLWriter;


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


/** Class for buffered reading int and double values */
public class Main{
	public static void main(String[] args) throws IOException {
		boolean possible=true;
		Reader.init(System.in);
		GraphList graph = new GraphList(26);
		int n =Reader.nextInt();
		String prev = Reader.next();
		for (int i=1;i<n;i++) {
			String curr= Reader.next();
			int l1=prev.length();
			int l2=curr.length();
			int min=0;
			if (l1<l2) {
				min=l1;
			}
			else {
				min=l2;
			}
			int flag=0;
			int bhagg=0;
			for (int j=0;j<min;j++) {
				if (prev.charAt(j)!=curr.charAt(j)) {
					flag=1;
					bhagg=j;
					break;
				}
			}
			if (flag==0) {
				if (l1>l2) {
					possible=false;
				}
			}
			else {
				//System.out.println(prev.charAt(bhagg)+" "+curr.charAt(bhagg));
				graph.addEdge(giceNo(prev.charAt(bhagg)), giceNo(curr.charAt(bhagg))  , 0);
			}
			prev=curr;
		}
		//System.out.println(graph.cycle);
		
		dijvertex ar[]=graph.topologicalSort();
		possible =(!graph.cycle)&&(possible);
		
		if (possible) {
			
			
			for (int j=25;j>=0;j--) {
				System.out.print(giceChar(ar[j].vertexNo));
			}
			System.out.println();
		}
		else {
			System.out.println("Impossible");
		}
	}
	
	public static char giceChar(int x) {
		if (x==0 ) {
			return 'a';
		}
		if (x==1 ) {
			return 'b';
		}
		if (x== 2) {
			return 'c';
		}
		if (x==3 ) {
			return 'd';
		}
		if (x== 4) {
			return 'e';
		}
		if (x== 5) {
			return 'f';
		}
		if (x== 6) {
			return 'g';
		}
		if (x== 7) {
			return 'h';
		}
		if (x== 8) {
			return 'i';
		}
		if (x== 9) {
			return 'j';
		}
		if (x== 10) {
			return 'k';
		}
		if (x== 11) {
			return 'l';
		}
		if (x== 12) {
			return 'm';
		}
		if (x== 13) {
			return 'n';
		}
		if (x== 14) {
			return 'o';
		}
		if (x== 15) {
			return 'p';
		}
		if (x== 16) {
			return 'q';
		}
		if (x== 17) {
			return 'r';
		}
		if (x== 18) {
			return 's';
		}
		if (x== 19) {
			return 't';
		}
		if (x== 20) {
			return 'u';
		}
		if (x== 21) {
			return 'v';
		}
		if (x== 22) {
			return 'w';
		}
		if (x== 23) {
			return 'x';
		}
		if (x== 24) {
			return 'y';
		}
		if (x== 25) {
			return 'z';
		}
		return 'a';
	}
	
	
	public static int giceNo(Character c) {
		if (c=='a' ) {
			return 0 ;
		}
		if (c=='b' ) {
			return 1;
		}
		if (c== 'c') {
			return 2;
		}
		if (c== 'd') {
			return 3;
		}
		if (c== 'e') {
			return 4;
		}
		if (c== 'f') {
			return 5;
		}
		if (c== 'g') {
			return 6;
		}
		if (c== 'h') {
			return 7 ;
		}
		if (c== 'i') {
			return 8;
		}
		if (c== 'j') {
			return 9;
		}
		if (c== 'k') {
			return 10 ;
		}
		if (c== 'l') {
			return 11;
		}
		if (c== 'm') {
			return 12;
		}
		if (c== 'n') {
			return 13;
		}
		if (c== 'o') {
			return 14;
		}
		if (c== 'p') {
			return 15;
		}
		if (c== 'q') {
			return 16;
		}
		if (c== 'r') {
			return 17;
		}
		if (c== 's') {
			return 18;
		}
		if (c== 't') {
			return 19;
		}
		if (c== 'u') {
			return 20;
		}
		if (c== 'v') {
			return 21;
		}
		if (c== 'w') {
			return 22;
		}
		if (c== 'x') {
			return 23;
		}
		if (c== 'y') {
			return 24;
		}
		if (c== 'z') {
			return 25 ;
		}
		return 0;
	}
}


class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
	
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}



class GraphList {

	boolean cycle;
	int dijkstraDIstarr[];
	int dijkstraParentarr[];
	int dijkstraVisitarr[];
	private int vertexNo;
	private LindekListAdj arrVertex[];
	int dfstime;
	int bfsvisitArr[];
	int bfsDistArr[];
	int bipartitearr[];
	boolean bipartite;

	public GraphList(int size) {
		this.cycle=false;
		this.bipartite = true;
		this.vertexNo = size;
		this.arrVertex = new LindekListAdj[size];
		for (int i = 0; i < size; i++) {
			arrVertex[i] = new LindekListAdj();
		}
		this.bfsvisitArr = new int[this.vertexNo];
		this.bfsDistArr = new int[this.vertexNo];
		for (int i = 0; i < this.vertexNo; i++) {
			this.bfsDistArr[i] = Integer.MAX_VALUE;
		}
		this.bipartitearr = new int[this.vertexNo];
	}

	public void addEdge(int i, int j, int w) {
		NodeAdj yo = new NodeAdj();
		yo.vertexNo = j;
		yo.weight = w;
		arrVertex[i].insert(yo);
	}

	public int[][] bfs(int i) {
		int vis[] = this.bfsvisitArr;
		vis[i] = 1;

		int distarr[] = this.bfsDistArr;
		ArrayList<Integer> queue = new ArrayList();
		int trial = 0;
		distarr[i] = trial;

		// for (int p = 0; p < this.vertexNo; p++) {
		// distarr[p] = Integer.MAX_VALUE;
		// }
		queue.add(i);
		while (!queue.isEmpty()) {
			int yo = queue.remove(0);
			trial = distarr[yo] + 1;
			NodeAdj ro = this.arrVertex[yo].head;
			while (ro != null) {
				if (vis[ro.vertexNo] == 0) {
					queue.add(ro.vertexNo);
					vis[ro.vertexNo] = 1;
					distarr[ro.vertexNo] = trial;
				}
				ro = ro.next;
			}
		}
		int bhagg[][] = new int[2][this.vertexNo];
		bhagg[0] = vis;
		bhagg[1] = distarr;
		return bhagg;

	}
	public dijvertex[] topologicalSort() {
		int bhagg[][]=dfs();
		int finarr[]=bhagg[2];
		dijvertex re[] = new dijvertex[this.vertexNo];
		for (int i=0;i<this.vertexNo;i++) {
			dijvertex yo = new dijvertex();
			yo.dist=finarr[i];
			yo.vertexNo=i;
			re[i]=yo;
			
		}
		mergesort(re, 0 ,this.vertexNo-1);
		return re;
	}
	
	public static void mergesort(dijvertex arr[], int low, int high) {// give low=0, high =len-1 while calling this function.
		if (low < high) {
			int mid = (high + low) / 2;
			mergesort(arr, low, mid);
			mergesort(arr, mid + 1, high);
		}
		int range=high-low+1;
		int j;
		int mid;
		if (range%2==0) {
			j=(range/2);
			mid=(range/2)-1;
		}
		else {
			j=(range/2)+1;
			mid=(range/2);
		}
		int i=0;
		//int mid = (high + low) / 2;
		//int i = low;
		//int j = mid + 1;
		int l = arr.length;
		int k = low;
		dijvertex aux[] = new dijvertex[range];
		for (int p = 0; p < range; p++) {
			aux[p] = arr[low+p];
		}
		while (i <= mid && j < range) {
			if (aux[i].dist <= aux[j].dist) {
				arr[k] = aux[i];
				i++;
			} else {
				arr[k] = aux[j];
				j++;
			}
			k++;
		}
		while (i <= mid) {
			arr[k] = aux[i];
			k++;
			i++;
		}
		while (j < range) {
			arr[k]=aux[j];
			k++;
			j++;
		}
		// comment maarna hai
//		if (high == low) {
//
//		} else {
//			for (int f = low; f <= high; f++) {
//				System.out.print(arr[f] + " ");
//			}
//			System.out.println();
//		}
		// yaha tak

	}
	
	
	
	
	
	public int[][] dfs() {
		this.dfstime = 0;
		int colorarr[] = new int[this.vertexNo];
		int discoveryarr[] = new int[this.vertexNo];
		int finalarr[] = new int[this.vertexNo];
		for (int i = 0; i < this.vertexNo; i++) {
			if (colorarr[i] == 0) {
				bipartitearr[i] = 1;
				dfsvisit(i, colorarr, discoveryarr, finalarr);
			}
		}
		int re[][] = new int[3][this.vertexNo];
		re[0] = colorarr;
		re[1] = discoveryarr;
		re[2] = finalarr;

		return re;

	}

	public void dfsvisit(int i, int colorarr[], int discoveryarr[], int finalarr[]) {
		colorarr[i] = 1; // marking grey
		dfstime++;
		discoveryarr[i] = dfstime;
		NodeAdj yo = this.arrVertex[i].head;

		while (yo != null) {
			if (bipartitearr[yo.vertexNo] == bipartitearr[i]) {
				bipartite = false;
			}
			if (colorarr[yo.vertexNo]==1) {
				//System.out.println(colorarr[yo.vertexNo]);
				this.cycle=true;
			}
			if (colorarr[yo.vertexNo] == 0) {
				
				if (bipartitearr[i] == 1) {
					bipartitearr[yo.vertexNo] = 2;
				} else {
					bipartitearr[yo.vertexNo] = 1;
				}
				dfsvisit(yo.vertexNo, colorarr, discoveryarr, finalarr);
			}
			yo = yo.next;
		}
		colorarr[i] = 2; // marking black
		dfstime++;
		finalarr[i] = dfstime;
	}

	public int[][] dijkstraDense(int i) {
		this.dijkstraDIstarr = new int[this.vertexNo];
		this.dijkstraParentarr = new int[this.vertexNo];
		this.dijkstraVisitarr = new int[this.vertexNo];
		for (int j = 0; j < this.vertexNo; j++) {
			dijkstraDIstarr[j] = Integer.MAX_VALUE;
		}
		for (int j = 0; j < this.vertexNo; j++) {
			dijkstraParentarr[j] = -1;
		}
		dijkstraDIstarr[i] = 0;
		//dijkstraVisitarr[i] = 1;

		for (int p = 0; p < this.vertexNo ; p++) {
			int min = Integer.MAX_VALUE;
			int minver = -1;
			for (int j = 0; j < this.vertexNo; j++) {
				if (dijkstraDIstarr[j] < min && dijkstraVisitarr[j]==0) {
					min = dijkstraDIstarr[j];
					minver = j;
				}

			}
			//System.out.println(minver);
			dijkstraVisitarr[minver] = 1;
			NodeAdj yo = this.arrVertex[minver].head;
			while (yo != null) {
				if (dijkstraVisitarr[yo.vertexNo] == 0) {
					if (dijkstraDIstarr[yo.vertexNo] > yo.weight + dijkstraDIstarr[minver]) {
						dijkstraDIstarr[yo.vertexNo] = yo.weight + dijkstraDIstarr[minver];
						dijkstraParentarr[yo.vertexNo]=minver;
					}
				}
				yo = yo.next;
			}
		}

	int re[][]=new int[2][this.vertexNo];
	re[0]=dijkstraDIstarr;
	re[1]=dijkstraParentarr;
	return re;
	}
	
	
	public int[][] dijkstraSparse(int i) {
		this.dijkstraDIstarr = new int[this.vertexNo];
		this.dijkstraParentarr = new int[this.vertexNo];
		this.dijkstraVisitarr = new int[this.vertexNo];
		for (int j = 0; j < this.vertexNo; j++) {
			dijkstraDIstarr[j] = Integer.MAX_VALUE;
		}
		for (int j = 0; j < this.vertexNo; j++) {
			dijkstraParentarr[j] = -1;
		}
		BinaryMinHeapArrayDij pq = new BinaryMinHeapArrayDij(this.vertexNo);
		pq.decreasekar(i, 0);
		
		dijkstraDIstarr[i] = 0;
		dijkstraVisitarr[i] = 1;

		while (pq.giveSize()!=0) {
			dijvertex min = pq.ExtractMin();
			int minver = min.vertexNo;
			
			//System.out.println("hi");
			dijkstraVisitarr[minver] = 1;
			NodeAdj yo = this.arrVertex[minver].head;
			while (yo != null) {
				if (dijkstraVisitarr[yo.vertexNo] == 0) {
					if (dijkstraDIstarr[yo.vertexNo] > yo.weight + dijkstraDIstarr[minver]) {
						dijkstraDIstarr[yo.vertexNo] = yo.weight + dijkstraDIstarr[minver];
						dijkstraParentarr[yo.vertexNo]=minver;
						pq.decreasekar(yo.vertexNo, yo.weight + dijkstraDIstarr[minver]);
					}
				}
				yo = yo.next;
			}
			
		}
		

	int re[][]=new int[2][this.vertexNo];
	re[0]=dijkstraDIstarr;
	re[1]=dijkstraParentarr;
	return re;
	}
	
}

class NodeAdj {
	int vertexNo;
	int weight;
	NodeAdj next;
}

class LindekListAdj {
	int size;
	NodeAdj head;
	NodeAdj tail;

	public void insert(NodeAdj bhagg) {
		// NodeAdj yo = head;
		if (this.head == null) {
			head = bhagg;
			tail = bhagg;
			size++;
			return;
		}
		tail.next = bhagg;
		tail = bhagg;
		size++;
	}

	public boolean isPresent(int ver) {
		if (this.head == null) {
			return false;
		}
		NodeAdj yo = head;
		while (yo != null) {
			if (yo.vertexNo == ver) {
				return true;
			}
			yo = yo.next;
		}
		return false;
	}
}















class BinaryMinHeapArrayDij {
	int indarr[];
	dijvertex heaparr[];
	int size;

	public BinaryMinHeapArrayDij(int cap) {
		heaparr = new dijvertex[cap];
		for (int j=0;j<cap;j++) {
			dijvertex yo = new dijvertex();
			yo.vertexNo=j;
			yo.dist=Integer.MAX_VALUE;
			heaparr[j]=yo;
		}
		size = cap;
		indarr = new int[cap];
		for (int j=0;j<cap;j++) {
			indarr[j]=j;
		}
		
	}

	public int giveSize() {
		return size;
	}

	public void printMinHeap() {
		for (dijvertex i : heaparr) {
			System.out.print(i.vertexNo + " ");
		}
		System.out.println();
	}

	public dijvertex giveMin() {
		if (size <= 0) {
			System.out.println("empty heap");
			return null;
		} else {
			return heaparr[0];
		}

	}

	public dijvertex ExtractMin() {
		return ExtractMin_ins();
	}

	private dijvertex ExtractMin_ins() {
		if (this.size <= 0) {
			System.out.println("heap underflow : emoty heap exception");
			return null;
		} else {
			
			dijvertex min = heaparr[0];
			indarr[min.vertexNo]=size-1;
			indarr[heaparr[size-1].vertexNo]=0;
			heaparr[0] = heaparr[size - 1];
			heaparr[size - 1] = null;
			heapify_ins(this.heaparr, 0, size - 2);
			size--;
			return min;
		}
	}

	public void heapify(int i) {
		heapify_ins(this.heaparr, i, this.size-1);
	}

	private void heapify_ins(dijvertex arr[], int i, int size) {
		int l = (2 * i) + 1;
		int r = (2 * i) + 2;
		int smallest;
		if (l <= size && arr[l].dist < arr[i].dist) {
			smallest = l;

		} else {
			smallest = i;
		}
		if (r <= size && arr[smallest].dist > arr[r].dist) {
			smallest = r;
		}
		if (smallest != i) {
			indarr[arr[i].vertexNo]=smallest;
			indarr[arr[smallest].vertexNo]=i;
			dijvertex temp = arr[i];
			arr[i] = arr[smallest];
			arr[smallest] = temp;
			heapify_ins(arr, smallest, size);
		}
	}
	public void decreasekar(int i , int key) {
		decrease(indarr[i], key);
	}
	public void decrease(int i, int key) {
		if (i<0 || i>size-1) {
			System.out.println("index out of bound");
		}
		else if (heaparr[i].dist<=key) {
			System.out.println("arr element is already smaller than given key");
		}
		else {
			heaparr[i].dist=key;
			while (i>0 && heaparr[(i-1)/2].dist>heaparr[i].dist) {
				indarr[heaparr[(i-1)/2].vertexNo]=i;
				indarr[heaparr[i].vertexNo]=(i-1)/2;
				dijvertex temp=heaparr[i];
				heaparr[i]=heaparr[(i-1)/2];
				heaparr[(i-1)/2]=temp;
				i=(i-1)/2;
			}
		}
	}

	

}
class dijvertex{
	int vertexNo;
	int dist;
}