//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <cmath>
#include <list>
#include <iomanip>
#include <set>
#include <map>
#include <sstream>
#include <fstream>
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;

#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define RFOR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define For(i,a,b) for(int (i)=(a);i<(b);++(i))
#define FoR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define MP make_pair
#define I insert
#define mod 1000000007
#define INF 1000000001
#define PB push_back
#define x0 sdfhrthrth
#define x1 fdhttrlhn
#define y0 kihrbdb
#define y1 ugvrrtgtrg
#define eps 1e-5
#define X first
#define Y second

int m;
string a[100000];
int g[50][50];
vector<int> now;

void main()
{
	cin>>m;
	For(i,0,m) cin>>a[i];
	For(i,0,m-1)
	{
		int j=0;
		while (a[i].size()>j && a[i+1].size()>j && a[i][j]==a[i+1][j]) j++;
		if (a[i].size()>j && a[i+1].size()>j)
			g[a[i+1][j]-'a'][a[i][j]-'a']=1;
		else
		if (a[i].size()>j && a[i+1].size()==j)
		{
			cout<<"Impossible";
			return;
		}
	}
	string ans="";
	For(i,0,'z'-'a'+1)
	{
		bool ok=0;
		For(j,0,50)
			if (g[i][j]) ok=1;
		if (!ok)
		{
			ans+=char('a'+i);
			now.PB(i);
		}
	}
	while (now.size())
	{
		int Q=now[now.size()-1];
		now.pop_back();
		For(i,0,50)
			if (g[i][Q]==1)
			{
				g[i][Q]=0;
				bool ok=0;
				For(t,0,50)
					if (g[i][t]) ok=1;
				if (!ok)
				{
					ans+=char('a'+i);
					now.PB(i);
				}
			}
	}
	if (ans.size()=='z'-'a'+1)
		cout<<ans;
	else cout<<"Impossible";

}


//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <cmath>
#include <list>
#include <iomanip>
#include <set>
#include <map>
#include <sstream>
#include <fstream>
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;

#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define RFOR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define For(i,a,b) for(int (i)=(a);i<(b);++(i))
#define FoR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define MP make_pair
#define I insert
#define mod 1000000007
#define INF 1000000001
#define PB push_back
#define x0 sdfhrthrth
#define x1 fdhttrlhn
#define y0 kihrbdb
#define y1 ugvrrtgtrg
#define eps 1e-5
#define X first
#define Y second

int m;
string a[100000];
int g[50][50];
vector<int> now;

void main()
{
	cin>>m;
	For(i,0,m) cin>>a[i];
	For(i,0,m-1)
	{
		int j=0;
		while (a[i].size()>j && a[i+1].size()>j && a[i][j]==a[i+1][j]) j++;
		if (a[i].size()>j && a[i+1].size()>j)
			g[a[i+1][j]-'a'][a[i][j]-'a']=1;
		else
		if (a[i].size()==j && a[i+1].size()>j)
		{
			cout<<"Impossible";
			return;
		}
	}
	string ans="";
	For(i,0,'z'-'a'+1)
	{
		bool ok=0;
		For(j,0,50)
			if (g[i][j]) ok=1;
		if (!ok)
		{
			ans+=char('a'+i);
			now.PB(i);
		}
	}
	while (now.size())
	{
		int Q=now[now.size()-1];
		now.pop_back();
		For(i,0,50)
			if (g[i][Q]==1)
			{
				g[i][Q]=0;
				bool ok=0;
				For(t,0,50)
					if (g[i][t]) ok=1;
				if (!ok)
				{
					ans+=char('a'+i);
					now.PB(i);
				}
			}
	}
	if (ans.size()=='z'-'a'+1)
		cout<<ans;
	else cout<<"Impossible";

}


#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<queue>
using namespace std;

vector<int> adj[30];
string names[200];
int sol[50];
queue<int> q;
int degree[40];
int n;

int main() {
	int i, maxlen = 0, j, k, current = 0, letter, x = 0;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> names[i];
		if (names[i].length() > maxlen) {
			maxlen = names[i].length();
		}
	}
	/*
	for (i = 0; i < maxlen; i++) {
		for (j = 0; j < n; j++) {
			for (k = j + 1; k < n; k++) {
				if (names[j].length() > i && names[k].length() > i && names[j][i] != names[k][i]) {
					adj[names[j][i] - 'a'].push_back(names[k][i] - 'a');
					degree[names[k][i] - 'a']++;
				}
			}
		}
	}*/

	for (i = 0; i < n; i++) {
		for (j = i + 1; j < n; j++) {
			for (k = 0; k < names[i].length() && k < names[j].length(); k++) {
				if (names[i][k] != names[j][k]) {
					adj[names[i][k] - 'a'].push_back(names[j][k] - 'a');
					degree[names[j][k] - 'a']++;
					break;
				}
			}
		}
	}

	for (i = 0; i < 26; i++) {
		if (degree[i] == 0) {
			q.push(i);
		}
	}

	while (!q.empty()) {
		x++;
		letter = q.front();
	//	cout << letter << endl;
		sol[current] = letter;
		current++;
		q.pop();

		for (i = 0; i < adj[letter].size(); i++) {
			degree[adj[letter][i]]--;
		//	cout << (char)(letter + 'a') << "-> " << (char)(adj[letter][i] + 'a') << endl;
			if (degree[adj[letter][i]] == 0) {
				q.push(adj[letter][i]);
			}
		}
	}

	if (x != 26) {
		cout << "Impossible\n";
	} else {
		for (i = 0; i < 26; i++) {
			cout << (char) ('a' + sol[i]);
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<queue>
using namespace std;

vector<int> adj[30];
string names[200];
int sol[50];
queue<int> q;
int degree[40];
int n;

int main() {
	int i, maxlen = 0, j, k, current = 0, letter, x = 0, not = 0;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> names[i];
		if (names[i].length() > maxlen) {
			maxlen = names[i].length();
		}
	}
	/*
	for (i = 0; i < maxlen; i++) {
		for (j = 0; j < n; j++) {
			for (k = j + 1; k < n; k++) {
				if (names[j].length() > i && names[k].length() > i && names[j][i] != names[k][i]) {
					adj[names[j][i] - 'a'].push_back(names[k][i] - 'a');
					degree[names[k][i] - 'a']++;
				}
			}
		}
	}*/

	for (i = 0; i < n; i++) {
		for (j = i + 1; j < n; j++) {
			for (k = 0; k < names[i].length(); k++) {
				if (k >= names[j].length()) {
					cout << "Impossible\n";
					return 0;
				}
				if (names[i][k] != names[j][k]) {
					adj[names[i][k] - 'a'].push_back(names[j][k] - 'a');
					degree[names[j][k] - 'a']++;
					break;
				}
			}
		}
	}

	for (i = 0; i < 26; i++) {
		if (degree[i] == 0) {
			q.push(i);
		}
	}

	while (!q.empty()) {
		x++;
		letter = q.front();
	//	cout << letter << endl;
		sol[current] = letter;
		current++;
		q.pop();

		for (i = 0; i < adj[letter].size(); i++) {
			degree[adj[letter][i]]--;
		//	cout << (char)(letter + 'a') << "-> " << (char)(adj[letter][i] + 'a') << endl;
			if (degree[adj[letter][i]] == 0) {
				q.push(adj[letter][i]);
			}
		}
	}

	if (x != 26) {
		cout << "Impossible\n";
	} else {
		for (i = 0; i < 26; i++) {
			cout << (char) ('a' + sol[i]);
		}
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <map>
#include <cstdlib>
#include <fstream>
#include <unordered_set>

using namespace std;

vector<int> g[1000];
int t = 0;

int was[1000];
int tout[1000];
bool dfs(int v) {
    if (was[v] == 1) return false;
    if (was[v] == 2) return true;
    was[v] = 1;
    for (int i = 0; i < g[v].size(); i++)
        if (!dfs(g[v][i]))
            return false;
    tout[v] = t++;
    was[v] = 2;
    return true;
}
int main() {

    int n;
    cin >> n;
    string a[1000];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    for (int i = 1; i < n; i++) {
        int j = 0;
        while (j < a[i].length() && j < a[i - 1].length() && a[i][j] == a[i - 1][j])
            j++;
        if (j < a[i].length() && j < a[i - 1].length())
            g[a[i - 1][j] - 'a'].push_back(a[i][j] - 'a');
    }

    for (int i = 0; i < 1000; i++)
        was[i] = false;
    for (int i = 0; i < 26; i++)
        if (!was[i])
            if (!dfs(i)){
                cout << "Impossible";
                return 0;
            }

    vector<pair<int, int> > ans;
    for (int i = 0; i < 26; i++)
        ans.push_back(make_pair(-tout[i], i));
    sort(ans.begin(), ans.end());
    for (int i = 0; i < 26; i++)
        cout << (char)(ans[i].second + 'a');

    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <map>
#include <cstdlib>
#include <fstream>
#include <unordered_set>

using namespace std;

vector<int> g[1000];
int t = 0;

int was[1000];
int tout[1000];
bool dfs(int v) {
    if (was[v] == 1) return false;
    if (was[v] == 2) return true;
    was[v] = 1;
    for (int i = 0; i < g[v].size(); i++)
        if (!dfs(g[v][i]))
            return false;
    tout[v] = t++;
    was[v] = 2;
    return true;
}
int main() {

    int n;
    cin >> n;
    string a[1000];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    for (int i = 1; i < n; i++) {
        int j = 0;
        while (j < a[i].length() && j < a[i - 1].length() && a[i][j] == a[i - 1][j])
            j++;
        if (j < a[i].length() && j < a[i - 1].length())
            g[a[i - 1][j] - 'a'].push_back(a[i][j] - 'a');
        if (j >= a[i].length() && j < a[i - 1].length())
            {
                cout << "Impossible";
                return 0;
            }
    }

    for (int i = 0; i < 1000; i++)
        was[i] = false;
    for (int i = 0; i < 26; i++)
        if (!was[i])
            if (!dfs(i)){
                cout << "Impossible";
                return 0;
            }

    vector<pair<int, int> > ans;
    for (int i = 0; i < 26; i++)
        ans.push_back(make_pair(-tout[i], i));
    sort(ans.begin(), ans.end());
    for (int i = 0; i < 26; i++)
        cout << (char)(ans[i].second + 'a');

    return 0;
}


// Roman V. Konovalov
// Microsoft Visual Studio Express 2013 for Windows Desktop

#include <string>
#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;

template <class T>
class zArray{
	friend class TestzArray;
protected:
	int n;
	T *p;
	void CriticalError(){
		//Application->MessageBox("Range Out","zArray Critical Error");
		cout << "zArray Critical Error: Range Out";
	}
	virtual int RealLen(int i){
		//return 10*((i-1)/10+1);  -> Old release
		if (i == 0)return 0;
		int RL = 1;
		i--;
		for (; i>0; i >>= 1)RL <<= 1;
		return RL;
	}
public:
	zArray(){
		n = 0;
	}
	~zArray(){
		Free();
	}
	int Len(){
		return n;
	}
	void Free(){
		if (n)delete[]p;
		n = 0;
	}
	void SetLen(int new_n){
		if (new_n<0)return;
		if (RealLen(n) == RealLen(new_n) && n != 0 && new_n != 0){
			n = new_n;
			return;
		}
		T *new_p = 0;
		int min = (n<new_n ? n : new_n);
		if (new_n)new_p = new T[RealLen(new_n)];
		for (int i = 0; i<min; i++)new_p[i] = p[i];
		if (n)delete[]p;
		n = new_n;
		p = new_p;
	}

	T & operator [](int i){
		if (i< -n || i >= n){//CriticalError();
			string s = "Range Out:  Array Size = ";  //s += to_string(n);
			s += "  Call operator [] with value = "; //s += to_string(i);
			//Application->MessageBox(s.c_str(),"zArray Critical Error");
			cout << "zArray Critical Error: " << s;
		}
		if (i >= 0)return p[i];
		else    return p[n - (-i)];
	}
	T & last(){
		if (n == 0)CriticalError();
		return p[n - 1];
	}
	T* GetP(){
		if (!n)return 0;
		return p;
	}

	T& Add(){
		SetLen(n + 1);
		return last();
	}
	void Add(T &t){
		SetLen(n + 1);
		p[n - 1] = t;
	}

	void Delete(int i){
		if (i<0 || i >= n)CriticalError();
		for (int k = i; k<n - 1; k++)p[k] = p[k + 1];
		SetLen(n - 1);
	}
	T& Insert(int i){
		if (i<0 || i>n)CriticalError();
		Add();
		for (int k = n - 1; k>i; k--)p[k] = p[k - 1];
		return p[i];
	}
	void Insert(int i, T &t){
		Insert(i) = t;
	}
	zArray & operator=(const zArray &a){
		if (this == &a)return *this;
		SetLen(a.n);
		for (int i = 0; i<n; i++)p[i] = a.p[i];
		return *this;
	}

	void Sort(){
		T *tmp = new T[n];
		T *m, *m1 = p, *m2 = tmp;
		int i1, i2, j, keylen;

		for (keylen = 1; keylen<2 * n; keylen *= 2){   // exampl: n=5
			for (j = 0; j<n; j += 2 * keylen){
				for (i1 = i2 = 0; i1<keylen && i2<keylen && j + keylen + i2<n;){
					if (m1[j + i1] <= m1[j + keylen + i2]){
						m2[j + i1 + i2] = m1[j + i1];        i1++;
					}
					else{
						m2[j + i1 + i2] = m1[j + keylen + i2]; i2++;
					}
				}
				for (; i1<keylen && j + i1<n; i1++)
					m2[j + i1 + i2] = m1[j + i1];
				for (; i2<keylen && j + keylen + i2<n; i2++)
					m2[j + i1 + i2] = m1[j + keylen + i2];
			}
			m = m1;
			m1 = m2;
			m2 = m;
		}
		delete[]tmp;
	}
	bool CheckSort(){
		int i;
		for (i = 1; i<n; i++)if (p[i - 1]>p[i]){
			//Application->MessageBox("Sort Algorithm Incorrectly",
			//                        "MemArray Critical Error");
			cout << "zArray Critical Error: MemArray Critical Error";
			return false;
		}
		return true;
	}

	int BinSearch(T &value){
		// 1. ���� �������� � ����� ��������� ���,
		// ���������� �����-������ ������� � ����� ������
		// (������� ��� ������� value).
		// 2. ���� ��������� ��������� �� ��������� value,
		// �� ���������� ������� � ���������� �������.
		// 3. Method use only "bool operator <=(const T&)"
		// definition for type T
		if (n == 0)return -1;
		int i, min = 0, max = n - 1;
		while (true){
			if (min == max)return min;
			if (min + 1 == max){
				if (value <= p[min])return min;
				return max;
			}
			i = min + (max - min) / 2;
			if (value <= p[i])max = i;
			else           min = i;
		}
	}
};

typedef zArray <int> zIntArray;
typedef zArray <double> zDoubleArray;
typedef zArray <string> zStringArray;
typedef zArray <char> zCharArray;
typedef zArray <zIntArray> zInt2DArray;
typedef zArray <zDoubleArray> zDouble2DArray;
typedef zArray <zStringArray> zString2DArray;
typedef zArray <zCharArray> zChar2DArray;

//###################################################################

void main(){
	cout.precision(15);

	int i, n;
	zStringArray z;
	string s;
	cin >> n;
	for (i = 0; i < n; i++){
		z.Add();
		cin >> s;
		z[-1] = s;
	}

	int L1, L2, j;
	zChar2DArray diff;
	for (i = 0; i < (n - 1); i++){
		L1 = z[i].length();
		L2 = z[i + 1].length();
		for (j = 0; j < min(L1, L2); j++)if (z[i][j] != z[i + 1][j])break;
		if ((j == min(L1, L2)) && (L1 > L2)){ cout << "Impossible"; return; }
		if (j < min(L1, L2)){
			diff.Add();
			if (z[i][j] < z[i + 1][j]){ diff[-1].Add() = z[i][j]; diff[-1].Add() = z[i + 1][j]; }
			else { diff[-1].Add() = z[i + 1][j]; diff[-1].Add() = z[i][j]; }
		}
	}

	char c;
	string r;
	while (diff.Len()){
		for (i = 0; i < diff.Len(); i++){
			for (j = 0; j < diff.Len(); j++)if (diff[i][0] == diff[j][1])break;
			if (j == diff.Len())break;
		}
		if (i == diff.Len()){ cout << "Impossible"; return; }
		r += diff[i][0];
		c = diff[i][0];
		for (i = 0; i < diff.Len(); ){
			if (diff[i][0] == c)diff.Delete(i);
			else i++;
		}
	}

	for (i = 0; i < 26; i++){
		for (j = 0; j < r.length(); j++)if (r[j] == ('a' + i))break;
		if (j == r.length())r += char('a' + i);
	}

	cout << r;
}


// Roman V. Konovalov
// Microsoft Visual Studio Express 2013 for Windows Desktop

#include <string>
#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;

template <class T>
class zArray{
	friend class TestzArray;
protected:
	int n;
	T *p;
	void CriticalError(){
		//Application->MessageBox("Range Out","zArray Critical Error");
		cout << "zArray Critical Error: Range Out";
	}
	virtual int RealLen(int i){
		//return 10*((i-1)/10+1);  -> Old release
		if (i == 0)return 0;
		int RL = 1;
		i--;
		for (; i>0; i >>= 1)RL <<= 1;
		return RL;
	}
public:
	zArray(){
		n = 0;
	}
	~zArray(){
		Free();
	}
	int Len(){
		return n;
	}
	void Free(){
		if (n)delete[]p;
		n = 0;
	}
	void SetLen(int new_n){
		if (new_n<0)return;
		if (RealLen(n) == RealLen(new_n) && n != 0 && new_n != 0){
			n = new_n;
			return;
		}
		T *new_p = 0;
		int min = (n<new_n ? n : new_n);
		if (new_n)new_p = new T[RealLen(new_n)];
		for (int i = 0; i<min; i++)new_p[i] = p[i];
		if (n)delete[]p;
		n = new_n;
		p = new_p;
	}

	T & operator [](int i){
		if (i< -n || i >= n){//CriticalError();
			string s = "Range Out:  Array Size = ";  //s += to_string(n);
			s += "  Call operator [] with value = "; //s += to_string(i);
			//Application->MessageBox(s.c_str(),"zArray Critical Error");
			cout << "zArray Critical Error: " << s;
		}
		if (i >= 0)return p[i];
		else    return p[n - (-i)];
	}
	T & last(){
		if (n == 0)CriticalError();
		return p[n - 1];
	}
	T* GetP(){
		if (!n)return 0;
		return p;
	}

	T& Add(){
		SetLen(n + 1);
		return last();
	}
	void Add(T &t){
		SetLen(n + 1);
		p[n - 1] = t;
	}

	void Delete(int i){
		if (i<0 || i >= n)CriticalError();
		for (int k = i; k<n - 1; k++)p[k] = p[k + 1];
		SetLen(n - 1);
	}
	T& Insert(int i){
		if (i<0 || i>n)CriticalError();
		Add();
		for (int k = n - 1; k>i; k--)p[k] = p[k - 1];
		return p[i];
	}
	void Insert(int i, T &t){
		Insert(i) = t;
	}
	zArray & operator=(const zArray &a){
		if (this == &a)return *this;
		SetLen(a.n);
		for (int i = 0; i<n; i++)p[i] = a.p[i];
		return *this;
	}

	void Sort(){
		T *tmp = new T[n];
		T *m, *m1 = p, *m2 = tmp;
		int i1, i2, j, keylen;

		for (keylen = 1; keylen<2 * n; keylen *= 2){   // exampl: n=5
			for (j = 0; j<n; j += 2 * keylen){
				for (i1 = i2 = 0; i1<keylen && i2<keylen && j + keylen + i2<n;){
					if (m1[j + i1] <= m1[j + keylen + i2]){
						m2[j + i1 + i2] = m1[j + i1];        i1++;
					}
					else{
						m2[j + i1 + i2] = m1[j + keylen + i2]; i2++;
					}
				}
				for (; i1<keylen && j + i1<n; i1++)
					m2[j + i1 + i2] = m1[j + i1];
				for (; i2<keylen && j + keylen + i2<n; i2++)
					m2[j + i1 + i2] = m1[j + keylen + i2];
			}
			m = m1;
			m1 = m2;
			m2 = m;
		}
		delete[]tmp;
	}
	bool CheckSort(){
		int i;
		for (i = 1; i<n; i++)if (p[i - 1]>p[i]){
			//Application->MessageBox("Sort Algorithm Incorrectly",
			//                        "MemArray Critical Error");
			cout << "zArray Critical Error: MemArray Critical Error";
			return false;
		}
		return true;
	}

	int BinSearch(T &value){
		// 1. ���� �������� � ����� ��������� ���,
		// ���������� �����-������ ������� � ����� ������
		// (������� ��� ������� value).
		// 2. ���� ��������� ��������� �� ��������� value,
		// �� ���������� ������� � ���������� �������.
		// 3. Method use only "bool operator <=(const T&)"
		// definition for type T
		if (n == 0)return -1;
		int i, min = 0, max = n - 1;
		while (true){
			if (min == max)return min;
			if (min + 1 == max){
				if (value <= p[min])return min;
				return max;
			}
			i = min + (max - min) / 2;
			if (value <= p[i])max = i;
			else           min = i;
		}
	}
};

typedef zArray <int> zIntArray;
typedef zArray <double> zDoubleArray;
typedef zArray <string> zStringArray;
typedef zArray <char> zCharArray;
typedef zArray <zIntArray> zInt2DArray;
typedef zArray <zDoubleArray> zDouble2DArray;
typedef zArray <zStringArray> zString2DArray;
typedef zArray <zCharArray> zChar2DArray;

//###################################################################

void main(){
	cout.precision(15);

	int i, n;
	zStringArray z;
	string s;
	cin >> n;
	for (i = 0; i < n; i++){
		z.Add();
		cin >> s;
		z[-1] = s;
	}

	int L1, L2, j;
	zChar2DArray diff;
	for (i = 0; i < (n - 1); i++){
		L1 = z[i].length();
		L2 = z[i + 1].length();
		for (j = 0; j < min(L1, L2); j++)if (z[i][j] != z[i + 1][j])break;
		if ((j == min(L1, L2)) && (L1 > L2)){ cout << "Impossible"; return; }
		if (j < min(L1, L2)){
			diff.Add();
			diff[-1].Add() = z[i][j];
			diff[-1].Add() = z[i + 1][j];
		}
	}

	char c;
	string r;
	while (diff.Len()){
		for (i = 0; i < diff.Len(); i++){
			for (j = 0; j < diff.Len(); j++)if (diff[i][0] == diff[j][1])break;
			if (j == diff.Len())break;
		}
		if (i == diff.Len()){ cout << "Impossible"; return; }
		r += diff[i][0];
		c = diff[i][0];
		for (i = 0; i < diff.Len(); ){
			if (diff[i][0] == c)diff.Delete(i);
			else i++;
		}
	}

	for (i = 0; i < 26; i++){
		for (j = 0; j < r.length(); j++)if (r[j] == ('a' + i))break;
		if (j == r.length())r += char('a' + i);
	}

	cout << r;
}


#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
int n, a[26][26],cnt[26],ch[26];
string re;
char s[101][101];

void solve(){
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%s", s[i]);
	}

	for (int i = 0; i < n; i++){
		for (int j = i + 1; j < n; j++){
			int len = min(strlen(s[i]), strlen(s[j]));
			for (int k = 0; k < len; k++){
				if (s[i][k] != s[j][k]){
					a[s[j][k] - 'a'][s[i][k] - 'a'] = 1;
					break;
				}
			}
		}
	}

	set<char>st;
	for (int i = 0; i < 26; i++){
		for (int j = 0; j < 26; j++){
			if (a[i][j])
				cnt[i]++;
		}
		if (!cnt[i]){
			st.insert('a' + i);
		}
	}

	for (; !st.empty(); ){
		int flag = 0;
		for (auto j = st.begin(); j != st.end() && !flag; j = st.begin()){

			if (!ch[*j - 'a']){
				re += *j;
				ch[*j - 'a'] = 1;
			}

			for (int k = 0; k < 26; k++){
				if (a[k][*j-'a']){
					cnt[k]--;
					a[k][*j - 'a']--;
					if (cnt[k] == 0){
						//re += 'a' + k;
						//ch[k] = 1;
						st.insert(k+'a');
						flag = 1;
					}
				}
			}
			if (flag)
				break;
			st.erase(st.begin());
		}
	}

	if (re.size() != 26)
		printf("Impossible\n");
	else
		printf("%s\n", re.c_str());
}

int main(void){
	//freopen("input.txt", "r", stdin);
	solve();
	return 0;
}


#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
int n, a[26][26],cnt[26],ch[26];
string re;
char s[101][101];

void solve(){
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%s", s[i]);
	}

	for (int i = 0; i < n; i++){
		for (int j = i + 1; j < n; j++){
			int len = min(strlen(s[i]), strlen(s[j]));
			for (int k = 0; k < len; k++){
				if (s[i][k] != s[j][k]){
					a[s[j][k] - 'a'][s[i][k] - 'a'] = 1;
					break;
				}
				else if (k == len - 1 && strlen(s[i]) > strlen(s[j])){
					puts("Impossible");
					return;
				}
			}
		}
	}

	set<char>st;
	for (int i = 0; i < 26; i++){
		for (int j = 0; j < 26; j++){
			if (a[i][j])
				cnt[i]++;
		}
		if (!cnt[i]){
			st.insert('a' + i);
		}
	}

	for (; !st.empty(); ){
		int flag = 0;
		for (auto j = st.begin(); j != st.end() && !flag; j = st.begin()){

			if (!ch[*j - 'a']){
				re += *j;
				ch[*j - 'a'] = 1;
			}

			for (int k = 0; k < 26; k++){
				if (a[k][*j-'a']){
					cnt[k]--;
					a[k][*j - 'a']--;
					if (cnt[k] == 0){
						//re += 'a' + k;
						//ch[k] = 1;
						st.insert(k+'a');
						flag = 1;
					}
				}
			}
			if (flag)
				break;
			st.erase(st.begin());
		}
	}

	if (re.size() != 26)
		printf("Impossible\n");
	else
		printf("%s\n", re.c_str());
}

int main(void){
	//freopen("input.txt", "r", stdin);
	solve();
	return 0;
}


//
//  main.cpp
//  #290-A
//
//  Created by KJBS2 on 2015. 2. 3..
//  Copyright (c) 2015년 KJBS2. All rights reserved.
//

#include <stdio.h>
#include <algorithm>
#include <vector>

#define MAX_N 500

using namespace std;

vector<int> V[MAX_N];

int N;
char Name[MAX_N][MAX_N];
int Cnt[MAX_N];
int Check[MAX_N];
int Answer[MAX_N], Ans;

void Erase(int now) {
    for(int i=0; i<V[now].size(); i++) {
        int next = V[now][i];
        Cnt[next] --;
        if(Cnt[next] == 0 && Check[next] == 0) {
            Answer[++Ans] = next;
            Check[next] = 1;
            Erase(next);
        }
    }
}

int main() {
    scanf("%d", &N);
    for(int i=1; i<=N; i++) {
        scanf("%s", Name[i]+1);
        for(int j=1; j<i; j++) {
            for(int k=1; Name[i][k]!=0 && Name[j][k]!=0; k++) {
                if(Name[i][k] != Name[j][k]) {
//                    printf("%c %c\n", Name[j][k], Name[i][k]);

                    V[ Name[j][k] ].push_back(Name[i][k]);
                    Cnt[Name[i][k]]++;

                    break;
                }
            }
        }
    }
    for(int p='a'; p<='z'; p++) {
        if(Cnt[p] == 0 && Check[p] == 0) {
            Answer[++Ans] = p;
            Check[p] = 1;
            Erase(p);
        }
    }

    if(Ans != 26) {
        printf("Impossible\n");
        return 0;
    }

    for(int i=1; i<=26; i++)
        printf("%c", Answer[i]);

    return 0;
}


//
//  main.cpp
//  #290-A
//
//  Created by KJBS2 on 2015. 2. 3..
//  Copyright (c) 2015년 KJBS2. All rights reserved.
//

#include <stdio.h>
#include <algorithm>
#include <vector>

#define MAX_N 500

using namespace std;

vector<int> V[MAX_N];

int N;
char Name[MAX_N][MAX_N];
int Cnt[MAX_N];
int Check[MAX_N];
int Answer[MAX_N], Ans;

void Erase(int now) {
    for(int i=0; i<V[now].size(); i++) {
        int next = V[now][i];
        Cnt[next] --;
        if(Cnt[next] == 0) {
            Answer[++Ans] = next;
            Check[next] = 1;
            Erase(next);
        }
    }
}

int main() {
    scanf("%d", &N);
    for(int i=1; i<=N; i++) {
        scanf("%s", Name[i]+1);
        for(int j=1; j<i; j++) {
            for(int k=1; Name[i][k]!=0 && Name[j][k]!=0; k++) {
                if(Name[i][k] != Name[j][k]) {
//                    printf("%c %c\n", Name[j][k], Name[i][k]);

                    V[ Name[j][k] ].push_back(Name[i][k]);
                    Cnt[Name[i][k]]++;

                    break;
                }
            }
        }
    }
    for(int p='a'; p<='z'; p++) {
        if(Cnt[p] == 0 && Check[p] == 0) {
            Answer[++Ans] = p;
            Check[p] = 1;
            Erase(p);
        }
    }

    if(Ans != 26) {
        printf("Impossible\n");
        return 0;
    }

    for(int i=1; i<=26; i++)
        printf("%c", Answer[i]);

    return 0;
}


//
//  main.cpp
//  #290-A
//
//  Created by KJBS2 on 2015. 2. 3..
//  Copyright (c) 2015년 KJBS2. All rights reserved.
//

#include <stdio.h>
#include <algorithm>
#include <vector>

#define MAX_N 500

using namespace std;

vector<int> V[MAX_N];

int N;
char Name[MAX_N][MAX_N];
int Cnt[MAX_N];
int Check[MAX_N];
int Answer[MAX_N], Ans;

void Erase(int now) {
    for(int i=0; i<V[now].size(); i++) {
        int next = V[now][i];
        Cnt[next] --;
        if(Cnt[next] == 0 && Check[next] == 0) {
            Answer[++Ans] = next;
            Check[next] = 1;
            Erase(next);
        }
    }
}

int main() {
    scanf("%d", &N);
    for(int i=1; i<=N; i++) {
        scanf("%s", Name[i]+1);
        for(int j=1; j<i; j++) {
            int k;
            for(k=1; Name[i][k]!=0 && Name[j][k]!=0; k++) {
                if(Name[i][k] != Name[j][k]) {
//                    printf("%c %c\n", Name[j][k], Name[i][k]);

                    V[ Name[j][k] ].push_back(Name[i][k]);
                    Cnt[Name[i][k]]++;

                    break;
                }
            }
            if(Name[i][k] == 0 && Name[j][k] != 0) {
                printf("Impossible\n");
                return 0;
            }
        }
    }
    for(int p='a'; p<='z'; p++) {
        if(Cnt[p] == 0 && Check[p] == 0) {
            Answer[++Ans] = p;
            Check[p] = 1;
            Erase(p);
        }
    }

    if(Ans != 26) {
        printf("Impossible\n");
        return 0;
    }

    for(int i=1; i<=26; i++)
        printf("%c", Answer[i]);

    return 0;
}


#pragma comment(linker, "/STACK:256000000")
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <sstream>

using namespace std;

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define forv(i, v) forn(i, v.size())

#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair

#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;

#define ALP 26
#define NMAX 105

int n;
string s[NMAX];
bool g[ALP][ALP];
bool used[ALP];

int main()
{

    cin >> n;
    forn(i, n) cin >> s[i];

    forn(i, n - 1)
    {
        int pt = 0;
        while (pt < (int)s[i].size() && pt < (int)s[i + 1].size() && s[i][pt] == s[i + 1][pt]) pt++;
        if (pt == (int)s[i].size() && pt <= (int)s[i + 1].size()) continue;
        if (pt == (int)s[i + 1].size() && pt < (int)s[i].size())
        {
            cout << "Impossible\n";
            return 0;
        }

        g[s[i][pt] - 'a'][s[i + 1][pt] - 'a'] = 1;

    }

    string ans = "";

    bool ok = true;
    while (ok)
    {
        ok = false;
        forn(i, ALP)
        {
            if (used[i]) continue;
            bool good = true;
            forn(j, ALP)
            {
                if (g[j][i]) good = false;
            }
            if (good)
            {
                ans += char(i + 'a');
                used[i] = true;
                ok = true;
                forn(j, ALP) g[i][j] = false;
            }
        }
    }

    if (ans.size() == ALP)
    {
        cout << ans << endl;

    }
    else
        cout << "Impossible\n";
    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
bool f=1;
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[105];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    if(!f)return;
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
    if(a>b&&i==b)f=0;
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(f&&topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[105];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
bool f=1;
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[105];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
    if(a>b&&i==b)f=0;
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(f&&topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
bool f=1;
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[105];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
    if(a>b&&i==b)f=0;
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
bool f=1;
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[105];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
    if(a>b&&i==b)f=0;
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
bool f=1;
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[105];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
    if(a>b&&i==b)f=0;
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
char in[103][103];
int indeg[30],n,cnt,head[30];
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){};
}e[30];
inline void add(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
inline void solve(char*s1,char*s2)
{
    int i,a=strlen(s1),b=strlen(s2);
    for(i=0;i<a&&i<b;++i)
        if(s1[i]!=s2[i])
        {
            add(s1[i]-'a',s2[i]-'a');
            ++indeg[s2[i]-'a'];
            break;
        }
}
vector<int>ans;
queue<int>que;
bool topo()
{
    int i,j,k;
    ans.clear();
    while(!que.empty())que.pop();
    for(i=0;i<26;++i)
        if(!indeg[i])que.push(i);
    while(!que.empty())
    {
        k=que.front();que.pop();
        ans.push_back(k);
        for(i=head[k];i!=-1;i=e[i].n)
        {
            j=e[i].t;--indeg[j];
            if(!indeg[j])que.push(j);
        }
    }
    return ans.size()==26;
}
int main()
{
    int i,j,k;
    scanf("%d",&n);
    memset(head,-1,sizeof(head));
    for(k=1;k<=n;++k)
        scanf(" %s",in+k);
    for(k=1;k<n;++k)
        solve(in[k],in[k+1]);
    if(topo())
    {
        for(i=0;i<26;++i)putchar(ans[i]+'a');
        putchar('\n');
    }
    else printf("Impossible\n");
    return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
//#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <limits>
#include <cassert>
#include <ctime>
#include <list>
#include <bitset>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<typename T> inline T Abs(T a){ return a>0 ? a : -a; }
template<typename T> inline T sqr(T a){ return a*a; }
template<typename T> inline void relaxMin(T &a, T b){ if (b<a) a = b; }
template<typename T> inline void relaxMax(T &a, T b){ if (b>a) a = b; }

#define _(a,val) memset(a,val,sizeof a);
#define REP(i, a, b) for(int i(a),_bb(b); i < _bb; ++i)
//#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define REPD(i, a, b) for(int i = (b) - 1; i >= a; --i)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()

const int INF = (int)(1E9+42);
const ll INF64 = (ll)1E18;
//const int INF = INT_MAX/2-1;
const long double EPS = 1E-8;
const long double PI = 3.1415926535897932384626433832795;
#define y1 idfgoseincdjkg
typedef vector<int> vint;
typedef pair<int, int> pii;

#undef assert
int assert(bool expr){ if (!(expr)) { ++*(char*)0; }; return 0; }

char s[100][110];

bool le[26][26];
//int order[26];

void fail()
{
    puts("Impossible");
    exit(0);
}

bool used[26];
vector<int> order;

void solve()
{
    int n; scanf("%d", &n);
    for (int i = 0; i < n; ++i)
        scanf("%s", s[i]);
    for (int i = 0; i < n-1; ++i)
    {
        int p = 0;
        while (s[i][p] == s[i + 1][p]) ++p;
        if (s[i + 1][p] == 0 && s[i][p] != 0)
            fail();
        le[s[i][p] - 'a'][s[i + 1][p] - 'a'] = true;
    }
    for (int i = 0; i < n; ++i)
    {
        for (int j = i + 1; j < n; ++j)
        {
            if (le[i][j] && le[j][i])
                fail();
        }
    }
    for (int i = 0; i < 26; ++i)
    {
        int nxt = 0;
        while (used[nxt]) ++nxt;
        bool found = true;
        for (int k = 0; found && k < 26;k++)
        {
            found = false;
            for (int j = 0; j < 26; ++j)
            {
                if (!used[j] && le[j][nxt])
                {
                    found = true;
                    nxt = j;
                    break;
                }
            }
        }
        if (found)
            fail();
        used[nxt] = true;
        order.push_back(nxt);
    }
    for (int i = 0; i < 26; ++i)
        putchar('a' + order[i]);
    putchar('\n');
}

int main(){
#ifdef acm
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	freopen("error.txt", "wt", stderr);
#else
	//freopen("polygon.in", "rt", stdin);
	//freopen("polygon.out", "wt", stdout);
#endif
	srand(0xA1B2C3D4);
	//pre();
	//int tc; cin>>tc; while(tc--) solve();
	solve();

#ifdef acm
	printf("\n\n\n\n\n%.3lf\n", clock()*1e-3);
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
//#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <limits>
#include <cassert>
#include <ctime>
#include <list>
#include <bitset>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<typename T> inline T Abs(T a){ return a>0 ? a : -a; }
template<typename T> inline T sqr(T a){ return a*a; }
template<typename T> inline void relaxMin(T &a, T b){ if (b<a) a = b; }
template<typename T> inline void relaxMax(T &a, T b){ if (b>a) a = b; }

#define _(a,val) memset(a,val,sizeof a);
#define REP(i, a, b) for(int i(a),_bb(b); i < _bb; ++i)
//#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define REPD(i, a, b) for(int i = (b) - 1; i >= a; --i)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()

const int INF = (int)(1E9+42);
const ll INF64 = (ll)1E18;
//const int INF = INT_MAX/2-1;
const long double EPS = 1E-8;
const long double PI = 3.1415926535897932384626433832795;
#define y1 idfgoseincdjkg
typedef vector<int> vint;
typedef pair<int, int> pii;

#undef assert
int assert(bool expr){ if (!(expr)) { ++*(char*)0; }; return 0; }

char s[100][110];

bool le[26][26];

void fail()
{
    puts("Impossible");
    exit(0);
}

bool used[26];
vector<int> order;

vector<int> used1;
bool dfs(int v, int s)
{
    if (v == s)
        return true;
    if (used1[v])
        return false;
    used1[v] = 1;
    for (int i = 0; i < 26; ++i)
        if (le[v][i] && dfs(i,s))
            return true;
    return false;
}

void solve()
{
    int n; scanf("%d", &n);
    for (int i = 0; i < n; ++i)
        scanf("%s", s[i]);
    for (int i = 0; i < n-1; ++i)
    {
        int p = 0;
        while (s[i][p] == s[i + 1][p]) ++p;
        if (s[i + 1][p] == 0 && s[i][p] != 0)
            fail();
        le[s[i][p] - 'a'][s[i + 1][p] - 'a'] = true;
    }
    for (int i = 0; i < n; ++i)
    {
        for (int j = i + 1; j < n; ++j)
        {
            //if (le[i][j] && le[j][i])
            //    fail();
        }
    }
    for (int i = 0; i < 26; ++i)
    {
        used1.assign(26, 0);
        for (int j = 0; j < 26;++j)
            if (le[i][j] && dfs(j,i))
                fail();
    }
    for (int i = 0; i < 26; ++i)
    {
        int nxt = 0;
        while (used[nxt]) ++nxt;
        bool found = true;
        for (int k = 0; found && k < 26;k++)
        {
            found = false;
            for (int j = 0; j < 26; ++j)
            {
                if (!used[j] && le[j][nxt])
                {
                    found = true;
                    nxt = j;
                    break;
                }
            }
        }
        if (found)
            fail();
        used[nxt] = true;
        order.push_back(nxt);
    }
    for (int i = 0; i < 26; ++i)
        putchar('a' + order[i]);
    putchar('\n');
}

int main(){
#ifdef acm
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	freopen("error.txt", "wt", stderr);
#else
	//freopen("polygon.in", "rt", stdin);
	//freopen("polygon.out", "wt", stdout);
#endif
	srand(0xA1B2C3D4);
	//pre();
	//int tc; cin>>tc; while(tc--) solve();
	solve();

#ifdef acm
	printf("\n\n\n\n\n%.3lf\n", clock()*1e-3);
#endif
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <cmath>
#include <climits>
#include <cassert>

using namespace std;

typedef long long     ll;
typedef double        dbl;
typedef long double   ld;

#define X             first
#define Y             second
#define mp            make_pair
#define pb            push_back
#define sz(x)         (int)(x).size()
#define all(x)        x.begin(),x.end()

const int maxn = 2000 * 100 + 10;
const int mod = 1e9 + 7;

vector <int> g[26];
vector <int> color;
vector <bool> used;
bool cycle;

void checkcycles(int v) {
	color[v] = 1;
	for (int i = 0; i < sz(g[v]); i++) {
		if (color[g[v][i]] == 0)
			checkcycles(g[v][i]);
		else if (color[g[v][i]] == 1) {
			cycle = true;
			break;
		}
	}
	color[v] = 2;
}

vector<int> ans;

void dfs(int v) {
	used[v] = true;
	for (size_t i = 0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (!used[to])
			dfs(to);
	}
	ans.push_back(v);
}

void topological_sort() {
	used.assign(26, false);
	ans.clear();
	for (int i = 0; i < 26; ++i)
		if (!used[i])
			dfs(i);
	reverse(ans.begin(), ans.end());
}
int main() {
#ifdef _DEBUG
	assert(freopen("input.txt", "r", stdin));
	assert(freopen("output.txt", "w", stdout));
#endif

	int n;
	scanf("%d", &n);
	getchar();
	vector <string> s(n);
	for (int i = 0; i < n; i++)
		getline(cin, s[i]);

	for (int i = 0; i < n - 1; i++) {
		int j = 0;
		while ((j < sz(s[i])) && (j < sz(s[i + 1])) && (s[i][j] == s[i + 1][j]))
			j++;
		if ((j < sz(s[i])) && (j == sz(s[i + 1]))) {
			puts("Impossible");
			return 0;
		}
		if (j < sz(s[i]))
			g[s[i][j] - 'a'].pb(s[i + 1][j] - 'a');
	}

	color.assign(26, 0);
	cycle = false;
	for (int i = 0; i < 26; ++i)
		if (color[i] == 0)
			checkcycles(i);

	if (cycle) {
		puts("Impossible");
		return 0;
	}

	topological_sort();
	for (int i = 0; i < 26; i++) {
		printf("%c", ans[i] + 'a');
	}

#ifdef _DEBUG
	cerr << "\nTIME ELAPSED: " << (dbl)clock() / CLOCKS_PER_SEC << " sec\n";
#endif
	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <string>
#include <cassert>
#include <queue>
#include <stack>
#include <limits>
using namespace std;
typedef long long ll;
#define M_PI       3.14159265358979323846
string s[107];
vector <int> gr[107],ts;
bool f(string s1,string s2){
    int l1=s1.length(),l2=s2.length();
    if(l2<=l1){
        for(int i=0;i<l2;i++) if(s1[i]!=s2[i]) return true;
        return false;
    }
    return true;
}
void f1(string s1,string s2){
    int l1=s1.length(),l2=s2.length();
    int mn=min(l1,l2);
    for(int i=0;i<mn;i++){
        if(s1[i]!=s2[i]){
            gr[s1[i]-'a'].push_back(s2[i]-'a');
            return;}
    }
}
int  vv[107];
bool cyc=false;
void dfs(int v){
    vv[v]=1;
    for(int i=0;i<gr[v].size();i++){
        if(vv[gr[v][i]]==0) dfs(gr[v][i]);
        else{
            if(vv[gr[v][i]]==1) cyc=true;
        }
    }
    vv[v]=2;
    ts.push_back(v);
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cin>>s[i];
    for(int i=1;i<n;i++){
        for(int j=0;j<i;j++){
            if(f(s[j],s[i])==false){ cout<<"Impossible\n"; return 0;}
            if(f(s[i],s[j])){
                f1(s[j],s[i]);
            }
        }
    }
    for(int i=0;i<26;i++)
        if(vv[i]==0) dfs(i);
    if(cyc==true){ cout<<"Impossible\n"; return 0;}
    reverse(ts.begin(),ts.end());
    for(int i=0;i<26;i++) cout<<char(ts[i]+'a');
    //cin>>n;
}


#include <stdio.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <string.h>
#include <list>
#include <time.h>

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define PI 3.14159265358979
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define L(s) (int)((s).size())
#define sz(s) (int)((s).size())
#define ms(x) memset(x,0,sizeof(x))
#define ms1(x) memset(x,-1,sizeof(x))
#define del(y,x) erase(y.begin()+x)

typedef long long ll;
using namespace std;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;
const int ST = 100010;
const int ST1 = 1000010;
const ll MOD = 1000000007;

ll ABS(ll a) {
    if(a<0)
        return a*(-1);
    else
        return a;
}

vector<string> vs;
char ans[40];
int otn[28][28];
bool used[27];
int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;
	for(int i = 0;i < n;i++){
		string a;
		cin >> a;
		vs.pb(a);
	}
	bool good = true;
	for(int i = 1;i < n && good;i++){
		bool f = false;
		for(int j = 0;j < L(vs[i-1]) && j < L(vs[i]);j++){
			if(vs[i-1][j]==vs[i][j])
				continue;
			int p1 = vs[i-1][j]-'a';
			int p2 = vs[i][j]-'a';
			f = true;
			if(otn[p1][p2]==0){
				otn[p1][p2] = 1;
				otn[p2][p1] = -1;
			}
			else
				if(otn[p1][p2]==-1)
					good = false;
			break;
		}
		if(f==false && L(vs[i])>=L(vs[i-1]))
			f = true;
		if(!f)
			good = false;
	}
	for(int i = 0;i < 26;i++){
		int cond = 0;
		for(int j = 0;j < 27;j++){
			if(!used[j]){
				cond = j;
				break;
			}
		}
		bool wasch = true;
		for(int itt = 0;itt < 30 && wasch;itt++){
			wasch = false;
			for(int j = 0;j < 27;j++){
				if(!used[j]){
					if(otn[cond][j]==-1){
						cond = j;
						wasch = true;
					}
				}
			}
			if(itt==29 && wasch==true)
				good = false;
		}
		used[cond] = true;
		ans[i] = cond+'a';
	}
	if(good){
		for(int i = 0;i < 26;i++){
			cout << ans[i];
		}
	}
	else
		cout << "Impossible";
	cout << endl;
//#ifdef _DEBUG
//    for(int i = 0;i < L(vs);i++){
//		for(int j = 0;j < L(vs[i]);j++){
//			char t;
//			for(int w = 0;w < 26;w++)
//				if(vs[i][j]==ans[w])
//					t = w+'a';
//			cout << t;
//		}
//		cout << endl;
//	}
//#endif

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <string.h>
#include <list>
#include <time.h>

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define PI 3.14159265358979
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define L(s) (int)((s).size())
#define sz(s) (int)((s).size())
#define ms(x) memset(x,0,sizeof(x))
#define ms1(x) memset(x,-1,sizeof(x))
#define del(y,x) erase(y.begin()+x)

typedef long long ll;
using namespace std;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;
const int ST = 100010;
const int ST1 = 1000010;
const ll MOD = 1000000007;

ll ABS(ll a) {
    if(a<0)
        return a*(-1);
    else
        return a;
}

vector<string> vs;
char ans[40];
int otn[28][28];
bool used[27];
int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;
	for(int i = 0;i < n;i++){
		string a;
		cin >> a;
		vs.pb(a);
	}
	bool good = true;
	for(int i = 1;i < n && good;i++){
		bool f = false;
		for(int j = 0;j < L(vs[i-1]) && j < L(vs[i]);j++){
			if(vs[i-1][j]==vs[i][j])
				continue;
			int p1 = vs[i-1][j]-'a';
			int p2 = vs[i][j]-'a';
			f = true;
			if(otn[p1][p2]==0){
				otn[p1][p2] = 1;
				otn[p2][p1] = -1;
			}
			else
				if(otn[p1][p2]==-1)
					good = false;
			break;
		}
		if(f==false && L(vs[i])>=L(vs[i-1]))
			f = true;
		if(!f)
			good = false;
	}
	for(int i = 0;i < 26;i++){
		int cond = 0;
		for(int j = 0;j < 27;j++){
			if(!used[j]){
				cond = j;
				break;
			}
		}
		for(int itt = 0;itt < 27;itt++){
			for(int j = 0;j < 27;j++){
				if(!used[j]){
					if(otn[cond][j]==-1){
						cond = j;
					}
				}
			}
		}
		used[cond] = true;
		ans[i] = cond+'a';
	}
	if(good){
		for(int i = 0;i < 26;i++){
			cout << ans[i];
		}
	}
	else
		cout << "Impossible";
	cout << endl;
//#ifdef _DEBUG
//    for(int i = 0;i < L(vs);i++){
//		for(int j = 0;j < L(vs[i]);j++){
//			char t;
//			for(int w = 0;w < 26;w++)
//				if(vs[i][j]==ans[w])
//					t = w+'a';
//			cout << t;
//		}
//		cout << endl;
//	}
//#endif

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n;
char name[105][105];
bool g[256][256];
bool used[256];
char p[256];
vector<char> topol;

void rec(int from, int to, int pos) {
	if (name[from][pos] == 0) return;
	for (int i = from; i <= to; i++) {
		int j = i;
		while (j < to && name[j + 1][pos] == name[j][pos]) j++;
		if (i != j) rec(i, j, pos + 1);
		if (j + 1 <= to) g[name[j][pos]][name[j + 1][pos]] = true;
	}
}

void dfs(int num) {
	if (used[num]) return;
	used[num] = true;
	for (int i = 'a'; i <= 'z'; i++) {
		if (g[num][i]) dfs(i);
	}
	topol.push_back(num);
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> name[i];
	}
	rec(0, n, 0);
	//for (char i = 'a'; i <= 'z'; i++) {
	//	for (char j = 'a'; j <= 'z'; j++) {
	//		if (g[i][j]) {
	//			printf("'%c' < '%c'\n", i, j);
	//		}
	//	}
	//}
	for (int i = 'a'; i <= 'z'; i++) {
		dfs(i);
	}
	reverse(topol.begin(), topol.end());
	for (int i = 0; i < topol.size(); i++) {
		p[topol[i]] = 'a' + i;
	}
	int pos = 'a';
	for (int i = topol.size(); i < 26; i++) {
		while (p[pos] != 0) pos++;
		p[pos] = 'a' + i;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= 100; j++) {
			name[i][j] = p[name[i][j]];
		}
	}
	for (int i = 0; i < n - 1; i++) {
		if (strcmp(name[i], name[i + 1]) > 0) {
			printf("Impossible");
			return 0;
		}
	}
	//for (int i = 'a'; i <= 'z'; i++) putchar(i);cout << endl;
	for (int i = 'a'; i <= 'z'; i++) putchar(p[i]);

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n;
char name[105][105];
bool g[256][256];
bool used[256];
char p[256];
vector<char> topol;

void rec(int from, int to, int pos) {
	if (name[from][pos] == 0) return;
	for (int i = from; i <= to; i++) {
		int j = i;
		while (j < to && name[j + 1][pos] == name[j][pos]) j++;
		if (i != j) rec(i, j, pos + 1);
		if (j + 1 <= to) g[name[j][pos]][name[j + 1][pos]] = true;
		i = j;
	}
}

void dfs(int num) {
	if (used[num]) return;
	used[num] = true;
	for (int i = 'a'; i <= 'z'; i++) {
		if (g[num][i]) dfs(i);
	}
	topol.push_back(num);
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> name[i];
	}
	rec(0, n, 0);
	//for (char i = 'a'; i <= 'z'; i++) {
	//	for (char j = 'a'; j <= 'z'; j++) {
	//		if (g[i][j]) {
	//			printf("'%c' < '%c'\n", i, j);
	//		}
	//	}
	//}
	for (int i = 'a'; i <= 'z'; i++) {
		dfs(i);
	}
	reverse(topol.begin(), topol.end());
	for (int i = 0; i < topol.size(); i++) {
		p[topol[i]] = 'a' + i;
	}
	int pos = 'a';
	for (int i = topol.size(); i < 26; i++) {
		while (p[pos] != 0) pos++;
		p[pos] = 'a' + i;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= 100; j++) {
			name[i][j] = p[name[i][j]];
		}
	}
	for (int i = 0; i < n - 1; i++) {
		if (strcmp(name[i], name[i + 1]) > 0) {
			printf("Impossible");
			return 0;
		}
	}
	//for (int i = 'a'; i <= 'z'; i++) putchar(i);cout << endl;
	//for (int i = 'a'; i <= 'z'; i++) putchar(p[i]);
	vector<pair<char, char>> ans;
	for (int i = 'a'; i <= 'z'; i++) ans.push_back(make_pair(p[i], i));
	sort(ans.begin(), ans.end());
	for (int i = 0; i < ans.size(); i++) cout << ans[i].second;

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n;
char name[105][105];
bool g[256][256];
bool used[256];
char p[256];
vector<char> topol;

void rec(int from, int to, int pos) {
	if (name[from][pos] == 0) return;
	for (int i = from; i <= to; i++) {
		int j = i;
		while (j < to && name[j + 1][pos] == name[j][pos]) j++;
		if (i != j) rec(i, j, pos + 1);
		if (j + 1 <= to) g[name[j][pos]][name[j + 1][pos]] = true;
	}
}

void dfs(int num) {
	if (used[num]) return;
	used[num] = true;
	for (int i = 'a'; i <= 'z'; i++) {
		if (g[num][i]) dfs(i);
	}
	topol.push_back(num);
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> name[i];
	}
	rec(0, n, 0);
	//for (char i = 'a'; i <= 'z'; i++) {
	//	for (char j = 'a'; j <= 'z'; j++) {
	//		if (g[i][j]) {
	//			printf("'%c' < '%c'\n", i, j);
	//		}
	//	}
	//}
	for (int i = 'a'; i <= 'z'; i++) {
		dfs(i);
	}
	reverse(topol.begin(), topol.end());
	for (int i = 0; i < topol.size(); i++) {
		p[topol[i]] = 'a' + i;
	}
	int pos = 'a';
	for (int i = topol.size(); i < 26; i++) {
		while (p[pos] != 0) pos++;
		p[pos] = 'a' + i;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= 100; j++) {
			name[i][j] = p[name[i][j]];
		}
	}
	for (int i = 0; i < n - 1; i++) {
		if (strcmp(name[i], name[i + 1]) > 0) {
			printf("Impossible");
			return 0;
		}
	}
	//for (int i = 'a'; i <= 'z'; i++) putchar(i);cout << endl;
	//for (int i = 'a'; i <= 'z'; i++) putchar(p[i]);
	vector<pair<char, char>> ans;
	for (int i = 'a'; i <= 'z'; i++) ans.push_back(make_pair(p[i], i));
	sort(ans.begin(), ans.end());
	for (int i = 0; i < ans.size(); i++) cout << ans[i].second;

	return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
const int MAX_N = 205;
const int MAX_ALPHA = 50;

string a[MAX_N];
int sm[MAX_ALPHA][MAX_ALPHA];
int flag[MAX_ALPHA];
int cnt_in[MAX_ALPHA], cnt_out[MAX_ALPHA];

vector<char> ans;
int used[MAX_ALPHA];

void dfs(char v)
{
	flag[v - 'a'] = 1;
	for (char i = 'a'; i <= 'z'; i++)
		if (sm[v - 'a'][i - 'a'])
		{
			if (flag[i - 'a'] == 1) {cout << "Impossible"; exit(0);}
			else if (flag[i - 'a'] == 0) dfs(i);
		}
	flag[v - 'a'] = 2;
	ans.push_back(v);
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];

	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
		{
			int len1 = (int)a[i].length();
			int len2 = (int)a[j].length();
			int p = 0;
			while (p < len1 && p < len2 && a[i][p] == a[j][p])
				p++;
			if (p == len2) {cout << "Impossible"; return 0;}
			if (p == len1) continue;
			sm[a[i][p] - 'a'][a[j][p] - 'a'] = 1;
			cnt_in[a[j][p] - 'a']++;
			cnt_out[a[i][p] - 'a']++;
		}

	for (char x = 'a'; x <= 'z'; x++)
		if (flag[x - 'a'] == 0 && cnt_in[x - 'a'] == 0 && cnt_out[x - 'a'] > 0)
			dfs(x);

	for (char x = 'a'; x <= 'z'; x++)
		if (flag[x - 'a'] == 0 && (cnt_out[x - 'a'] > 0 || cnt_in[x - 'a'] > 0))
		{
			cout << "Impossible";
			return 0;
		}

	reverse(ans.begin(), ans.end());
	for (int i = 0; i < (int)ans.size(); i++)
	{
		cout << ans[i];
		used[ans[i] - 'a'] = 1;
	}
	for (char x = 'a'; x <= 'z'; x++)
		if (!used[x - 'a'])
			cout << x;

	return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
const int MAX_N = 205;
const int MAX_LEN = 205;
const int MAX_ALPHA = 50;

string a[MAX_N];
int sm[MAX_ALPHA][MAX_ALPHA];
int flag[MAX_ALPHA];
int cnt_in[MAX_ALPHA], cnt_out[MAX_ALPHA];
int f = 1;

vector<char> w;
vector<char> ans;
int used[MAX_ALPHA];

void dfs(char v)
{
	flag[v - 'a'] = 1;
	for (char i = 'a'; i <= 'z'; i++)
		if (sm[v - 'a'][i - 'a'])
		{
			if (flag[i - 'a'] == 1) {f = 0; return;}
			else if (flag[i - 'a'] == 0) dfs(i);
		}
	flag[v - 'a'] = 2;
	w.push_back(v);
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];

	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
		{
			int len1 = (int)a[i].length();
			int len2 = (int)a[j].length();
			int p = 0;
			while (p < len1 && p < len2 && a[i][p] == a[j][p])
				p++;
			if (p == len2) {cout << "Impossible"; return 0;}
			if (p == len1) continue;
			sm[a[i][p] - 'a'][a[j][p] - 'a'] = 1;
			cnt_in[a[j][p] - 'a']++;
			cnt_out[a[i][p] - 'a']++;
		}

	for (char x = 'a'; x <= 'z'; x++)
		if (flag[x - 'a'] == 0 && cnt_in[x - 'a'] == 0 && cnt_out[x - 'a'] > 0)
		{
			w.clear();
			f = 1;
			dfs(x);
			if (f == 0) {cout << "Impossible"; return 0;}
			reverse(w.begin(), w.end());
			for (int j = 0; j < (int)w.size(); j++)
			{
				ans.push_back(w[j]);
				used[w[j] - 'a'] = 1;
			}
		}

	for (char x = 'a'; x <= 'z'; x++)
		if (flag[x - 'a'] == 0 && cnt_out[x - 'a'] > 0)
		{
			cout << "Impossible";
			return 0;
		}

	for (int i = 0; i < (int)ans.size(); i++)
		cout << ans[i];
	for (char x = 'a'; x <= 'z'; x++)
		if (!used[x - 'a'])
			cout << x;

	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;

struct CharNode {
	CharNode() : v(false) {}
	vector<CharNode*> next;
	vector<CharNode*> prev;
	bool v, a;
	char sym;
};

vector<char> result;
vector<CharNode> chars;

bool ds(int i) {
	if (chars[i].a == true) return false;
	if (chars[i].v == true) return true;
	chars[i].v = chars[i].a = true;
	bool res = true;
	for (size_t k = 0; k < chars[i].prev.size(); k++) {
		res = res && ds(chars[i].prev[k]->sym - 'a');
	}
	result.push_back((char)(i + (unsigned char)'a'));
	chars[i].a = false;
	return res;
}

int main() {

	chars.resize('z'-'a'+1);
	for (size_t i = 0; i < chars.size(); i++)
		chars[i].sym = (char)(i + (unsigned char)'a');
	string f,s;
	int n;
	cin >> n;
	getline(cin, f);
	getline(cin, s);
	for (int i = 0; i < n-1; i++) {
		f = s;
		getline(cin, s);
		size_t k;
		for (k = 0; k < f.size() && k < s.size(); k++) {
			if (f[k] != s[k]) break;
		}
		if (k != f.size()) {
			if (k == s.size()) {
				cout << "Impossible";
				return 0;
			} else {
				chars[f[k] - 'a'].next.push_back(&chars[s[k] -'a']);
				chars[s[k] - 'a'].prev.push_back(&chars[f[k] -'a']);
			}
		}
	}

	for (size_t i = 0; i < chars.size(); i++) {
		if (chars[i].v == false)
			if (!ds(i)) {
				cout << "Impossible";
				return 0;
			}
	}

	for (size_t i = 0; i < result.size(); i++)
		cout << result[i];

	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;

struct CharNode {
	CharNode() : v(false) {}
	vector<CharNode*> next;
	vector<CharNode*> prev;
	bool v, a;
	char sym;
};

vector<char> result;
vector<CharNode> chars;

bool ds(int i) {
	if (chars[i].a == true) return false;
	if (chars[i].v == true) return true;
	chars[i].v = chars[i].a = true;
	bool res = true;
	for (size_t k = 0; k < chars[i].prev.size(); k++) {
		res = res && ds(chars[i].next[k]->sym - 'a');
	}
	result.push_back((char)(i + (unsigned char)'a'));
	chars[i].a = false;
	return res;
}

int main() {

	chars.resize('z'-'a'+1);
	for (size_t i = 0; i < chars.size(); i++)
		chars[i].sym = (char)(i + (unsigned char)'a');
	string f,s;
	int n;
	cin >> n;
	getline(cin, f);
	getline(cin, s);
	for (int i = 0; i < n-1; i++) {
		f = s;
		getline(cin, s);
		size_t k;
		for (k = 0; k < f.size() && k < s.size(); k++) {
			if (f[k] != s[k]) break;
		}
		if (k != f.size()) {
			if (k == s.size()) {
				cout << "Impossible";
				return 0;
			} else {
				chars[f[k] - 'a'].next.push_back(&chars[s[k] -'a']);
				chars[s[k] - 'a'].prev.push_back(&chars[f[k] -'a']);
			}
		}
	}

	for (size_t i = 0; i < chars.size(); i++) {
		if (chars[i].v == false)
			if (!ds(i)) {
				cout << "Impossible";
				return 0;
			}
	}

	for (size_t i = 0; i < result.size(); i++)
		cout << result[i];

	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;

struct CharNode {
	CharNode() : v(false) {}
	vector<CharNode*> next;
	vector<CharNode*> prev;
	bool v, a;
	char sym;
};

vector<char> result;
vector<CharNode> chars;

bool ds(int i) {
	if (chars[i].a == true) return false;
	if (chars[i].v == true) return true;
	result.push_back((char)(i + (unsigned char)'a'));
	chars[i].v = chars[i].a = true;
	bool res = true;
	for (size_t k = 0; k < chars[i].next.size(); k++) {
		res = res && ds(chars[i].next[k]->sym - 'a');
	}
	chars[i].a = false;
	return res;
}

int main() {

	chars.resize('z'-'a'+1);
	for (size_t i = 0; i < chars.size(); i++)
		chars[i].sym = (char)(i + (unsigned char)'a');
	string f,s;
	int n;
	cin >> n;
	getline(cin, f);
	getline(cin, s);
	for (int i = 0; i < n-1; i++) {
		f = s;
		getline(cin, s);
		size_t k;
		for (k = 0; k < f.size() && k < s.size(); k++) {
			if (f[k] != s[k]) break;
		}
		if (k != f.size()) {
			if (k == s.size()) {
				cout << "Impossible";
				return 0;
			} else {
				chars[f[k] - 'a'].next.push_back(&chars[s[k] -'a']);
				chars[s[k] - 'a'].prev.push_back(&chars[f[k] -'a']);
			}
		}
	}

	for (size_t i = 0; i < chars.size(); i++) {
		if (chars[i].v == false)
			if (!ds(i)) {
				cout << "Impossible";
				return 0;
			}
	}

	for (size_t i = 0; i < result.size(); i++)
		cout << result[i];

	return 0;
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>

using namespace std;

bool fail = false;
char u[26];
vector<int> v[26];
vector<char> ans;

void add(string & a, string & b)
{
	for (int i = 0; i < min(a.length(), b.length()); ++i)
	{
		if (a[i] != b[i])
		{
			v[a[i] - 'a'].push_back(b[i] - 'a');
			return;
		}
	}
	if (a.length() > b.length())
		fail = true;
}

void dfs(int st)
{
	u[st] = 1;
	for (int i = 0; i < v[st].size(); ++i)
	{
		int to = v[st][i];
		if (u[to] == 1)
		{
			fail = true;
			return;
		}
		else if (u[to] == 0)
		{
			dfs(to);
			if (fail)
				return;
		}
	}
	ans.push_back('a' + st);
	u[st] = 2;
}

int main()
{
	int n;
	cin >> n;
	vector<string> s(n);
	for (int i = 0; i < n; ++i)
	{
		cin >> s[i];
	}
	for (int i = 1; i < n; ++i)
	{
		add(s[i - 1], s[i]);
	}
	if (fail)
	{
		cout << "Impossible";
		return 0;
	}
	for (int i = 0; i < 26; ++i)
		if (!u[i])
		{
			dfs(i);
			if (fail)
			{
				cout << "Impossible";
				return 0;
			}
		}
	for (int i = 25; i >= 0; --i)
		cout << ans[i];
    return 0;
}


#pragma comment(linker, "/STACK:133217728")
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <stdexcept>
#include <functional>
#include <math.h>
using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair

const int INF=2000000000;
const int MOD=1000000007;

int n;
string s[100];
int c[27][27];
string sol;
int was[27];
bool can=true;

void dfs(int ver)
{
	if (!can) return;
	was[ver]=1;

	FOR(i,0,27)
		if (c[ver][i])
		{
			if (was[i]==1)
			{
				can=false;
				break;
			}
			if (was[i]==0) dfs(i);
		}

	was[ver]=2;
	sol.push_back(ver+'a');
}

void go(int l, int r, int pos)
{
	//cerr << "new " << l << " " << r << " " << pos << endl;
	while (l<r && s[l].size()<pos+1) ++l;
	if (l>=r) return;
	int pr=l;
	FOR(i,l+1,r)
	if (s[i][pos]!=s[i-1][pos])
	{
		c[s[i][pos]-'a'][s[i-1][pos]-'a']=1;
		//cerr << s[i][pos] << " after " << s[i-1][pos] << endl;
		go(pr,i,pos+1);
		pr=i;
	}
	go(pr,r,pos+1);
}

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	FOR(i,0,26)
		was[i]=0;

	FOR(i,0,26)
		c[26][i]=1;

	cin >> n;

	FOR(i,0,n)
		cin >> s[i];

	go(0,n,0);
	dfs(26);

	if (can)
	{
		sol.pop_back();
		cout << sol << endl;

	}
	else
		cout << "Impossible" << endl;

	return 0;
}


#pragma comment(linker, "/STACK:133217728")
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <stdexcept>
#include <functional>
#include <math.h>
using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair

const int INF=2000000000;
const int MOD=1000000007;

int n;
string s[100];
int c[26][26];
string sol;
int was[26],deg[26];
bool can=true;

void dfs(int ver)
{
	if (!can) return;
	was[ver]=1;

	FOR(i,0,26)
		if (c[ver][i])
		{
			if (was[i]==1)
			{
				can=false;
				break;
			}
			if (was[i]==0) dfs(i);
		}

	was[ver]=2;
	sol.push_back(ver+'a');
}

void go(int l, int r, int pos)
{
	//cerr << "new " << l << " " << r << " " << pos << endl;
	while (l<r && s[l].size()<pos+1) ++l;
	if (l>=r) return;
	int pr=l;
	FOR(i,l+1,r)
	if (s[i][pos]!=s[i-1][pos])
	{
		c[s[i][pos]-'a'][s[i-1][pos]-'a']=1;
		//cerr << s[i][pos] << " after " << s[i-1][pos] << endl;
		deg[s[i-1][pos]-'a']++;
		go(pr,i,pos+1);
		pr=i;
	}
	go(pr,r,pos+1);
}

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	FOR(i,0,26)
		deg[i]=was[i]=0;

	cin >> n;

	FOR(i,0,n)
		cin >> s[i];

	go(0,n,0);

	FOR(i,0,26)
		if (deg[i]==0 && 0==was[i])
			dfs(i);

	FOR(i,0,26)
		if (was[i]==0)
			can=false;

	if (can)
		cout << sol << endl;
	else
		cout << "Impossible" << endl;

	return 0;
}


#pragma comment(linker, "/STACK:133217728")
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <stdexcept>
#include <functional>
#include <math.h>
using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair

const int INF=2000000000;
const int MOD=1000000007;

int n;
string s[100];
int c[27][27];
string sol;
int was[27];
bool can=true;

void dfs(int ver)
{
	if (!can) return;
	was[ver]=1;

	FOR(i,0,27)
		if (c[ver][i])
		{
			if (was[i]==1)
			{
				can=false;
				break;
			}
			if (was[i]==0) dfs(i);
		}

	was[ver]=2;
	sol.push_back(ver+'a');
}

void go(int l, int r, int pos)
{
	if (!can) return;
	//cerr << "new " << l << " " << r << " " << pos << endl;
	while (l<r && s[l].size()<pos+1) ++l;
	if (l>=r) return;
	int pr=l;
	FOR(i,l+1,r)
	{
		if (s[i].size()<pos+1)
		{
			can=false;
			break;
		}
		if (s[i][pos]!=s[i-1][pos])
		{
			c[s[i][pos]-'a'][s[i-1][pos]-'a']=1;
			//cerr << s[i][pos] << " after " << s[i-1][pos] << endl;
			go(pr,i,pos+1);
			pr=i;
		}
	}
	go(pr,r,pos+1);
}

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	FOR(i,0,26)
		was[i]=0;

	FOR(i,0,26)
		c[26][i]=1;

	cin >> n;

	FOR(i,0,n)
		cin >> s[i];

	go(0,n,0);
	if (can) dfs(26);

	if (can)
	{
		sol.pop_back();
		cout << sol << endl;
	}
	else
		cout << "Impossible" << endl;

	return 0;
}


//#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<ctime>
#include<queue>
#include<utility>
#include<iostream>
using namespace std;
#define E          2.71828182845904523536
#define PI         3.14159265358979323846
#define PI_2       1.57079632679489661923
#define PI_4       0.785398163397448309616
#define SQRT2      1.41421356237309504880
#define SQRT1_2    0.707106781186547524401
#define mcpy(from,to) memcpy((to),(from),sizeof((from)))
#define msetz(pp) memset((pp),0,sizeof((pp)))
#define mseto(pp) memset((pp),1,sizeof((pp)))
#define msetno(pp) memset((pp),-1,sizeof((pp)))
#define mseti(pp) memset((pp),0x3f3f3f3f,sizeof((pp)))
#define msetni(pp) memset((pp),0xc0c0c0c0,sizeof((pp)))
typedef pair<int,int> PII;
typedef __int64 LL;
const int INF=0x3f3f3f3f;
const double inf=1e20,eps=1e-8;
const double pi=acos(-1.0);
/*
const int MAXN=305;
const int MAXM=28005;
struct EDGE {
int u,v,w,next;
EDGE(int u=0,int v=0,int w=0,int next=-1):u(u),v(v),w(w),next(next) {}
bool operator < (const EDGE &tt) const {
return w<tt.w;
}
};
int head[MAXN],nEdge;
EDGE edge[MAXM];
void init() {
nEdge=0;
memset(head,-1,sizeof(head));
}
void addedge(int u,int v,int w) {
edge[nEdge]=EDGE(u,v,w,head[u]);
head[u]=nEdge++;
}
*/
template <class T>
void exGCD(T a,T b,T &d,T &x,T &y) {//ax+by==d=gcd(a,b)
	if(b==0) { d=a;x=T(1);y=T(0); }
	else { exGCD(b,a%b,d,y,x);y-=x*(a/b); }
}
template <class T>
T ceil(T aa,T bb) {
	if(bb<T(0)) { aa=-aa;bb=-bb; }
	if(aa>T(0)) return (aa-T(1))/bb+T(1);
	else return aa/bb;
}
template <class T>
T floor(T aa,T bb) {
	if(bb<T(0)) { aa=-aa;bb=-bb; }
	if(aa>=T(0)) return aa/bb;
	else return (aa+T(1))/bb-T(1);
}
template <class T> T lowbit(T x) { return x&(-x); }
template <class T> T gcd(T a,T b) { return b?gcd(b,a%b):a; }
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
	bool flag=(c=='-');
	if(flag) c=getchar();
	int x=0;
	while(c>='0'&&c<='9') {
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
LL readLL(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
	bool flag=(c=='-');
	if(flag) c=getchar();
	LL x=0ll;
	while(c>='0'&&c<='9') {
		x=x*10ll+LL(c-48);
		c=getchar();
	}
	return flag?-x:x;
}
void putint(int x){
	if(x<0) {
		putchar('-');
		x=-x;
	}
	int len=0,data[10];
	while(x) {
		data[len++]=x%10;
		x/=10;
	}
	if(!len) data[len++]=0;
	while(len--) putchar(data[len]+48);
	putchar('\n');
}
void putLL(LL x){
	if(x<0ll) {
		putchar('-');
		x=-x;
	}
	int len=0,data[30];
	while(x>0ll) {
		data[len++]=x%10ll;
		x/=10ll;
	}
	if(!len) data[len++]=0;
	while(len--) putchar(data[len]+48);
	putchar('\n');
}

bool mat[30][30];
vector<char> list;
char ss[105][105];
int ind[30];

void gao(int x) {
	int la=strlen(ss[x-1]),lb=strlen(ss[x]);
	int pos=0;
	while(pos<la&&pos<lb&&ss[x-1][pos]==ss[x][pos]) pos++;
	if(pos<la&&pos<lb) {
		mat[ss[x-1][pos]-'a'][ss[x][pos]-'a']=true;
		ind[ss[x][pos]-'a']++;
	}
}

int main() {
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) scanf("%s",ss[i]);
	for(int i=1;i<n;i++) gao(i);
	queue<int> q;
	for(int i=0;i<26;i++) if(ind[i]==0) q.push(i);
	while(!q.empty()) {
		int u=q.front();
		q.pop();
		list.push_back(u+'a');
		for(int i=0;i<26;i++)
		if(mat[u][i]) {
			ind[i]--;
			if(ind[i]==0) q.push(i);
		}
	}
	if(list.size()<26) {
		puts("Impossible");
	}
	else {
		for(int i=0;i<list.size();i++) putchar(list[i]);
		puts("");
	}
	return 0;
}


//#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<ctime>
#include<queue>
#include<utility>
#include<iostream>
using namespace std;
#define E          2.71828182845904523536
#define PI         3.14159265358979323846
#define PI_2       1.57079632679489661923
#define PI_4       0.785398163397448309616
#define SQRT2      1.41421356237309504880
#define SQRT1_2    0.707106781186547524401
#define mcpy(from,to) memcpy((to),(from),sizeof((from)))
#define msetz(pp) memset((pp),0,sizeof((pp)))
#define mseto(pp) memset((pp),1,sizeof((pp)))
#define msetno(pp) memset((pp),-1,sizeof((pp)))
#define mseti(pp) memset((pp),0x3f3f3f3f,sizeof((pp)))
#define msetni(pp) memset((pp),0xc0c0c0c0,sizeof((pp)))
typedef pair<int,int> PII;
typedef __int64 LL;
const int INF=0x3f3f3f3f;
const double inf=1e20,eps=1e-8;
const double pi=acos(-1.0);
/*
const int MAXN=305;
const int MAXM=28005;
struct EDGE {
int u,v,w,next;
EDGE(int u=0,int v=0,int w=0,int next=-1):u(u),v(v),w(w),next(next) {}
bool operator < (const EDGE &tt) const {
return w<tt.w;
}
};
int head[MAXN],nEdge;
EDGE edge[MAXM];
void init() {
nEdge=0;
memset(head,-1,sizeof(head));
}
void addedge(int u,int v,int w) {
edge[nEdge]=EDGE(u,v,w,head[u]);
head[u]=nEdge++;
}
*/
template <class T>
void exGCD(T a,T b,T &d,T &x,T &y) {//ax+by==d=gcd(a,b)
	if(b==0) { d=a;x=T(1);y=T(0); }
	else { exGCD(b,a%b,d,y,x);y-=x*(a/b); }
}
template <class T>
T ceil(T aa,T bb) {
	if(bb<T(0)) { aa=-aa;bb=-bb; }
	if(aa>T(0)) return (aa-T(1))/bb+T(1);
	else return aa/bb;
}
template <class T>
T floor(T aa,T bb) {
	if(bb<T(0)) { aa=-aa;bb=-bb; }
	if(aa>=T(0)) return aa/bb;
	else return (aa+T(1))/bb-T(1);
}
template <class T> T lowbit(T x) { return x&(-x); }
template <class T> T gcd(T a,T b) { return b?gcd(b,a%b):a; }
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
	bool flag=(c=='-');
	if(flag) c=getchar();
	int x=0;
	while(c>='0'&&c<='9') {
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
LL readLL(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
	bool flag=(c=='-');
	if(flag) c=getchar();
	LL x=0ll;
	while(c>='0'&&c<='9') {
		x=x*10ll+LL(c-48);
		c=getchar();
	}
	return flag?-x:x;
}
void putint(int x){
	if(x<0) {
		putchar('-');
		x=-x;
	}
	int len=0,data[10];
	while(x) {
		data[len++]=x%10;
		x/=10;
	}
	if(!len) data[len++]=0;
	while(len--) putchar(data[len]+48);
	putchar('\n');
}
void putLL(LL x){
	if(x<0ll) {
		putchar('-');
		x=-x;
	}
	int len=0,data[30];
	while(x>0ll) {
		data[len++]=x%10ll;
		x/=10ll;
	}
	if(!len) data[len++]=0;
	while(len--) putchar(data[len]+48);
	putchar('\n');
}

bool mat[30][30];
vector<char> list;
char ss[105][105];
int ind[30];

bool gao(int x) {
	int la=strlen(ss[x-1]),lb=strlen(ss[x]);
	int pos=0;
	while(pos<la&&pos<lb&&ss[x-1][pos]==ss[x][pos]) pos++;
	if(pos<la&&pos<lb) mat[ss[x-1][pos]-'a'][ss[x][pos]-'a']=true;
	if(pos<la&&pos==lb) return false;
	return true;
}

int main() {
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) scanf("%s",ss[i]);
	for(int i=1;i<n;i++)
	if(!gao(i)) {
		puts("Impossible");
	}
	for(int i=0;i<26;i++) for(int j=0;j<26;j++) if(mat[i][j]) ind[j]++;
	queue<int> q;
	for(int i=0;i<26;i++) if(ind[i]==0) q.push(i);
	while(!q.empty()) {
		int u=q.front();
		q.pop();
		list.push_back(u+'a');
		for(int i=0;i<26;i++)
		if(mat[u][i]) {
			ind[i]--;
			if(ind[i]==0) q.push(i);
		}
	}
	if(list.size()<26) {
		puts("Impossible");
	}
	else {
		for(int i=0;i<list.size();i++) putchar(list[i]);
		puts("");
	}
	return 0;
}


//#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<ctime>
#include<queue>
#include<utility>
#include<iostream>
using namespace std;
#define E          2.71828182845904523536
#define PI         3.14159265358979323846
#define PI_2       1.57079632679489661923
#define PI_4       0.785398163397448309616
#define SQRT2      1.41421356237309504880
#define SQRT1_2    0.707106781186547524401
#define mcpy(from,to) memcpy((to),(from),sizeof((from)))
#define msetz(pp) memset((pp),0,sizeof((pp)))
#define mseto(pp) memset((pp),1,sizeof((pp)))
#define msetno(pp) memset((pp),-1,sizeof((pp)))
#define mseti(pp) memset((pp),0x3f3f3f3f,sizeof((pp)))
#define msetni(pp) memset((pp),0xc0c0c0c0,sizeof((pp)))
typedef pair<int,int> PII;
typedef __int64 LL;
const int INF=0x3f3f3f3f;
const double inf=1e20,eps=1e-8;
const double pi=acos(-1.0);
/*
const int MAXN=305;
const int MAXM=28005;
struct EDGE {
int u,v,w,next;
EDGE(int u=0,int v=0,int w=0,int next=-1):u(u),v(v),w(w),next(next) {}
bool operator < (const EDGE &tt) const {
return w<tt.w;
}
};
int head[MAXN],nEdge;
EDGE edge[MAXM];
void init() {
nEdge=0;
memset(head,-1,sizeof(head));
}
void addedge(int u,int v,int w) {
edge[nEdge]=EDGE(u,v,w,head[u]);
head[u]=nEdge++;
}
*/
template <class T>
void exGCD(T a,T b,T &d,T &x,T &y) {//ax+by==d=gcd(a,b)
	if(b==0) { d=a;x=T(1);y=T(0); }
	else { exGCD(b,a%b,d,y,x);y-=x*(a/b); }
}
template <class T>
T ceil(T aa,T bb) {
	if(bb<T(0)) { aa=-aa;bb=-bb; }
	if(aa>T(0)) return (aa-T(1))/bb+T(1);
	else return aa/bb;
}
template <class T>
T floor(T aa,T bb) {
	if(bb<T(0)) { aa=-aa;bb=-bb; }
	if(aa>=T(0)) return aa/bb;
	else return (aa+T(1))/bb-T(1);
}
template <class T> T lowbit(T x) { return x&(-x); }
template <class T> T gcd(T a,T b) { return b?gcd(b,a%b):a; }
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
	bool flag=(c=='-');
	if(flag) c=getchar();
	int x=0;
	while(c>='0'&&c<='9') {
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
LL readLL(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
	bool flag=(c=='-');
	if(flag) c=getchar();
	LL x=0ll;
	while(c>='0'&&c<='9') {
		x=x*10ll+LL(c-48);
		c=getchar();
	}
	return flag?-x:x;
}
void putint(int x){
	if(x<0) {
		putchar('-');
		x=-x;
	}
	int len=0,data[10];
	while(x) {
		data[len++]=x%10;
		x/=10;
	}
	if(!len) data[len++]=0;
	while(len--) putchar(data[len]+48);
	putchar('\n');
}
void putLL(LL x){
	if(x<0ll) {
		putchar('-');
		x=-x;
	}
	int len=0,data[30];
	while(x>0ll) {
		data[len++]=x%10ll;
		x/=10ll;
	}
	if(!len) data[len++]=0;
	while(len--) putchar(data[len]+48);
	putchar('\n');
}

bool mat[30][30];
vector<char> list;
char ss[105][105];
int ind[30];

bool gao(int x) {
	int la=strlen(ss[x-1]),lb=strlen(ss[x]);
	int pos=0;
	while(pos<la&&pos<lb&&ss[x-1][pos]==ss[x][pos]) pos++;
	if(pos<la&&pos<lb) mat[ss[x-1][pos]-'a'][ss[x][pos]-'a']=true;
	if(pos<la&&pos==lb) return false;
	return true;
}

int main() {
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) scanf("%s",ss[i]);
	for(int i=1;i<n;i++)
	if(!gao(i)) {
		puts("Impossible");
		return 0;
	}
	for(int i=0;i<26;i++) for(int j=0;j<26;j++) if(mat[i][j]) ind[j]++;
	queue<int> q;
	for(int i=0;i<26;i++) if(ind[i]==0) q.push(i);
	while(!q.empty()) {
		int u=q.front();
		q.pop();
		list.push_back(u+'a');
		for(int i=0;i<26;i++)
		if(mat[u][i]) {
			ind[i]--;
			if(ind[i]==0) q.push(i);
		}
	}
	if(list.size()<26) {
		puts("Impossible");
	}
	else {
		for(int i=0;i<list.size();i++) putchar(list[i]);
		puts("");
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <algorithm>
#include <map>
#include <set>
#include <string.h>
#define MAXN 500000
#define INF 50000000
#define LL long long
#define re return

#define N 200
using namespace std;
typedef struct{ char s[101]; }ta;
ta all[101];
int cmp[30][30];
int main(){
#ifndef ONLINE_JUDGE
	ifstream cin("A.in");
	ofstream cout("A.out");
#endif
	int n;
	cin >> n; for (int i = 0; i < n; ++i)cin >> all[i].s;

	for (int i = 1; i < n; ++i){
		int s2 = strlen(all[i].s);
		int s1 = strlen(all[i-1].s);
		int l = min(s1,s2);
		bool bOk = true;
		for (int j = 0; j < l; ++j)if(all[i-1].s[j]!=all[i].s[j]){
			cmp[all[i - 1].s[j] - 'a'][all[i].s[j] - 'a'] = 1;
			bOk = false;
			break;
		}

		if (bOk && s1 > s2){
			cout << "Impossible";
			re 0;
		}
	}
	int p[50];
	for (int i = 0; i < 26; ++i)
		p[i] = i;
	for (int i = 0; i < 26; ++i){
		for (int k = 0; k < 260;++k)
		for (int j = i + 1; j < 26; ++j)if(cmp[p[j]][p[i]]){
			swap(p[i], p[j]);
		}
	}

	for (int i = 0; i < 26; ++i){
		for (int j = i + 1; j < 26; ++j){
			if (cmp[p[j]][p[i]]){
				cout << "Impossible";
				re 0;
			}
		}
	}
	for (int i = 0; i < 26; ++i)
		cout << (char)('a' + p[i]);
	re 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<iostream>
#include<algorithm>

using namespace std;

int n;
char s[105][105];
int l[105];

vector<vector<int> > g;

vector<int> ts;

int u[26];
bool loop = 0;

void dfs(int v)
{
    u[v] = 1;
    for (int i = 0; i < g[v].size(); i++)
    {
        int to = g[v][i];
        if (!u[to])
            dfs(to);
        else if (u[to] == 1)
        {
            loop = 1;
            return;
        }
    }

    u[v] = 2;
    ts.push_back(v);
}

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%s", s[i]);

    for (int i = 0; i < n; i++)
        l[i] = strlen(s[i]);

    g.resize(26);

    for (int i = 0; i < n - 1; i++)
    {
        for (int j = 0; j < l[i] && j < l[i + 1]; j++)
        {
            if (s[i][j] != s[i + 1][j])
            {
                g[s[i][j] - 'a'].push_back(s[i+1][j] - 'a');
                break;
            }
        }
    }

    for (int i = 0; i < 26; i++)
    {
        if (!u[i])
            dfs(i);
    }

    if (loop)
        printf("Impossible\n");
    else
    {
        for (int i = 25; i >= 0; i--)
            printf("%c", ts[i] + 'a');
        printf("\n");
    }

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<iostream>
#include<algorithm>

using namespace std;

int n;
char s[105][105];
int l[105];

vector<vector<int> > g;

vector<int> ts;

int u[26];
bool loop = 0;

void dfs(int v)
{
    u[v] = 1;
    for (int i = 0; i < g[v].size(); i++)
    {
        int to = g[v][i];
        if (!u[to])
            dfs(to);
        else if (u[to] == 1)
        {
            loop = 1;
            return;
        }
    }

    u[v] = 2;
    ts.push_back(v);
}

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%s", s[i]);

    for (int i = 0; i < n; i++)
        l[i] = strlen(s[i]);

    g.resize(26);

    for (int i = 0; i < n - 1; i++)
    {
        int p = 0;
        for (int j = 0; j < l[i] && j < l[i + 1]; j++, p++)
        {
            if (s[i][j] != s[i + 1][j])
            {
                g[s[i][j] - 'a'].push_back(s[i+1][j] - 'a');
                break;
            }
        }
        if (p == l[i + 1] && p < l[i])
            loop = 1;
    }

    for (int i = 0; i < 26; i++)
    {
        if (!u[i])
            dfs(i);
    }

    if (loop)
        printf("Impossible\n");
    else
    {
        for (int i = 25; i >= 0; i--)
            printf("%c", ts[i] + 'a');
        printf("\n");
    }

    return 0;
}


#include<iostream>
#include<string>
#include<set>
#include<vector>
using namespace std;

#define rep(a,b,c) for(int a=b;a<c;a++)
set<char> map[256];

bool check(string l,string s){
    int i=0;
    while(i<s.length() && i<l.length() && s[i]==l[i])
        i++;
    if(i>=s.length() && i<l.length())
        return 1;
    if(i>=s.length() && i>=l.length())
        return 0;
    if(i<s.length() && i>=l.length())
        return 0;
    map[l[i]].insert(s[i]);
    return 0;
}

bool visit (char  v, vector<char> &order, vector<char> &color) {
    color[v] = 1;
    for(set<char>::iterator i=map[v].begin();i!=map[v].end();i++){
        char c=*i;
        if (color[c] == 2) continue;
        if (color[c] == 1) return false;
        if (!visit(c, order, color)) return false;
    }
    order.push_back(v); color[v] = 2;
    return true;
}
bool topologicalSort(vector<char> &order) {
    vector<char> color(256);
    for(char i='a';i<='z';i++)
        if(!color[i] && !visit(i,order,color))
            return false;
    return true;
}

int main(){
    int n;
    string s,l;
    bool imp=0;
    cin>>n;
    char f=0;
    while(n--){
        cin>>s;
        if(f==0)f=s[0];
        imp|=check(l,s);
        l=s;
    }
    if(imp){
        cout<<"Impossible";
        return 0;
    }
    vector<char> ord;

    if(topologicalSort(ord)){
        for(int i=ord.size()-1;i>=0;i--)
            cout<<ord[i];
    }
    else{
        cout<<"Impossible";
    }

    return 0;
}


#include<iostream>
#include<string>
#include<set>
using namespace std;

#define rep(a,b,c) for(int a=b;a<c;a++)
set<char> g[256];
char col[256];
string s,l,r;
bool imp;

bool dfs(char v){
    col[v]=1;
    for(set<char>::iterator i=g[v].begin();i!=g[v].end();i++)
        if(col[*i]!=2) if(col[*i]==1 || !dfs(*i)) return 0;
    r=v+r;col[v]=2;
    return 1;
}

int main(){
    int n,i;
    cin>>n;
    while(n--){
        cin>>s;
        i=0;
        while(i<s.length() && i<l.length() && s[i]==l[i]) i++;
        if(i<l.length()){
            if(i<s.length()) g[l[i]].insert(s[i]);
            else imp=1;
        }
        l=s;
    }
    rep(j,'a','z'+1) imp|=!(col[j] || dfs(j));
    cout<<(imp?"Impossible":r);
    return 0;
}


#include<iostream>
#include<string>
#include<set>
#include<vector>
using namespace std;

#define rep(a,b,c) for(int a=b;a<c;a++)
set<char> map[256];
set<char> bmap;
string res;

bool check(string l,string s){
    int i=0;
    while(i<s.length() && i<l.length() && s[i]==l[i])
        i++;
    if(i>=s.length() && i<l.length())
        return 1;
    if(i>=s.length() && i>=l.length())
        return 0;
    if(i<s.length() && i>=l.length())
        return 0;
    if(map[l[i]].find(s[i])==map[l[i]].end()){
        map[l[i]].insert(s[i]);
        bmap.insert(s[i]);
        return 0;
    }
    return 1;
}

bool visit (char  v, vector<char> &order, vector<char> &color) {
    color[v] = 1;
    for(set<char>::iterator i=map[v].begin();i!=map[v].end();i++){
        char c=*i;
        if (color[c] == 2) continue;
        if (color[c] == 1) return false;
        if (!visit(c, order, color)) return false;
    }
    order.push_back(v); color[v] = 2;
    return true;
}
bool topologicalSort(vector<char> &order) {
    vector<char> color(256);
    for(char i='a';i<='z';i++)
        if(!color[i] && !visit(i,order,color))
            return false;
    return true;
}

int main(){
    int n;
    string s,l;
    bool imp=0;
    cin>>n;
    char f=0;
    while(n--){
        cin>>s;
        if(f==0)f=s[0];
        imp|=check(l,s);
        l=s;
    }
    if(imp){
        cout<<"Impossible";
        return 0;
    }
    vector<char> ord;

    if(topologicalSort(ord)){
        for(int i=ord.size()-1;i>=0;i--)
            cout<<ord[i];
    }
    else{
        cout<<"Impossible";
    }

    return 0;
}


#include "stdio.h"
#include "cstring"
#include "string"
#include "algorithm"
#include "cmath"
#include "iostream"
#include "map"
#include "vector"
#include "queue"
#include "set"
using namespace std;

int n;
int round;
vector<int> v[30],temp[30];
string str[105];
int vis[30];
int in[30];
void dfs(int s) {
	vis[s]=-1;
	for(int i=0;i<v[s].size();i++) {
		if(vis[v[s][i]] == 0) {
			dfs(v[s][i]);
			vis[v[s][i]]=1;
		}
		else if(vis[v[s][i]] == -1) {
			round=1;
			return;
		}
	}
	return;
}
int main() {
	cin>>n;
	int i,j,k;
	for(i=0;i<n;i++) cin>>str[i];
	memset(in,0,sizeof(in));
	for(i=0;i<n-1;i++) {
		j=0;
		int l1=str[i].length();
		int l2=str[i+1].length();
		while (j < l1 && j < l2 && str[i+1][j] == str[i][j]) j++;
		if(j < l1) {
			v[str[i][j]-'a'].push_back(str[i+1][j]-'a');
			in[str[i+1][j]-'a']++;
		}
	}
	round=0;
	for(i=0;i<26;i++) {
		memset(vis,0,sizeof(vis));
		dfs(i);
		if(round) break;
	}
	if(round) cout<<"Impossible"<<endl;
	else {
		j=0;
		while (1)
		{
			int f=0;
			for(i=0;i<26;i++) {
				if(in[i] == 0) {
					f=1;
					temp[j].push_back(i);
					in[i]--;
				}
			}
			for(k=0;k<temp[j].size();k++) {
				for(int t=0;t<v[temp[j][k]].size();t++) in[v[temp[j][k]][t]]--;
			}
			j++;
			if(!f) break;
		}
		for(i=0;i<j;i++) {
			for(k=0;k<temp[i].size();k++) printf("%c",temp[i][k]+'a');
		}
		printf("\n");
	}
	return 0;
}


#include "stdio.h"
#include "cstring"
#include "string"
#include "algorithm"
#include "cmath"
#include "iostream"
#include "map"
#include "vector"
#include "queue"
#include "set"
using namespace std;

int n;
int round;
vector<int> v[30],temp[30];
string str[105];
int vis[30];
int in[30];
void dfs(int s) {
	vis[s]=-1;
	for(int i=0;i<v[s].size();i++) {
		if(vis[v[s][i]] == 0) {
			dfs(v[s][i]);
			vis[v[s][i]]=1;
		}
		else if(vis[v[s][i]] == -1) {
			round=1;
			return;
		}
	}
	return;
}
int main() {
	cin>>n;
	int i,j,k;
	for(i=0;i<n;i++) cin>>str[i];
	memset(in,0,sizeof(in));
	round=0;
	for(i=0;i<n-1;i++) {
		j=0;
		int l1=str[i].length();
		int l2=str[i+1].length();
		while (j < l1 && j < l2 && str[i+1][j] == str[i][j]) j++;
		//printf("%d\n",j);
		//printf("%d %d\n",l1,l2);
		if(j < l1 && j < l2) {
			v[str[i][j]-'a'].push_back(str[i+1][j]-'a');
			in[str[i+1][j]-'a']++;
		}
		if(j == l2 && j < l1) {
			round=1;
			break;
		}
	}
	for(i=0;i<26;i++) {
		if(round) break;
		memset(vis,0,sizeof(vis));
		dfs(i);
	}
	if(round) cout<<"Impossible"<<endl;
	else {
		j=0;
		while (1)
		{
			int f=0;
			for(i=0;i<26;i++) {
				if(in[i] == 0) {
					f=1;
					temp[j].push_back(i);
					in[i]--;
				}
			}
			for(k=0;k<temp[j].size();k++) {
				for(int t=0;t<v[temp[j][k]].size();t++) in[v[temp[j][k]][t]]--;
			}
			j++;
			if(!f) break;
		}
		for(i=0;i<j;i++) {
			for(k=0;k<temp[i].size();k++) printf("%c",temp[i][k]+'a');
		}
		printf("\n");
	}
	return 0;
}


#include "stdio.h"
#include "cstring"
#include "string"
#include "algorithm"
#include "cmath"
#include "iostream"
#include "map"
#include "vector"
#include "queue"
#include "set"
using namespace std;

int n;
int round;
vector<int> v[30],temp[30];
string str[105];
int vis[30];
int in[30];
void dfs(int s) {
	vis[s]=-1;
	for(int i=0;i<v[s].size();i++) {
		if(vis[v[s][i]] == 0) {
			dfs(v[s][i]);
			vis[v[s][i]]=1;
		}
		else if(vis[v[s][i]] == -1) {
			round=1;
			return;
		}
	}
	return;
}
int main() {
	cin>>n;
	int i,j,k;
	for(i=0;i<n;i++) cin>>str[i];
	memset(in,0,sizeof(in));
	for(i=0;i<n-1;i++) {
		j=0;
		int l1=str[i].length();
		int l2=str[i+1].length();
		while (j < l1 && j < l2 && str[i+1][j] == str[i][j]) j++;
		if(j < l1) {
			v[str[i][j]-'a'].push_back(str[i+1][j]-'a');
			in[str[i+1][j]-'a']++;
		}
	}
	round=0;
	for(i=0;i<25;i++) {
		memset(vis,0,sizeof(vis));
		dfs(i);
		if(round) break;
	}
	if(round) cout<<"Impossible"<<endl;
	else {
		j=0;
		while (1)
		{
			int f=0;
			for(i=0;i<25;i++) {
				if(in[i] == 0) {
					f=1;
					temp[j].push_back(i);
					in[i]--;
				}
			}
			for(k=0;k<temp[j].size();k++) {
				for(int t=0;t<v[temp[j][k]].size();t++) in[v[temp[j][k]][t]]--;
			}
			j++;
			if(!f) break;
		}
		for(i=0;i<j;i++) {
			for(k=0;k<temp[i].size();k++) printf("%c",temp[i][k]+'a');
		}
		printf("\n");
	}
	return 0;
}


#include "stdio.h"
#include "cstring"
#include "string"
#include "algorithm"
#include "cmath"
#include "iostream"
#include "map"
#include "vector"
#include "queue"
#include "set"
using namespace std;

int n;
int round;
vector<int> v[30],temp[30];
string str[105];
int vis[30];
int in[30];
void dfs(int s) {
	vis[s]=-1;
	for(int i=0;i<v[s].size();i++) {
		if(vis[v[s][i]] == 0) {
			dfs(v[s][i]);
			vis[v[s][i]]=1;
		}
		else if(vis[v[s][i]] == -1) {
			round=1;
			return;
		}
	}
	return;
}
int main() {
	cin>>n;
	int i,j,k;
	for(i=0;i<n;i++) cin>>str[i];
	memset(in,0,sizeof(in));
	for(i=0;i<n-1;i++) {
		j=0;
		int l1=str[i].length();
		int l2=str[i+1].length();
		while (j < l1 && j < l2 && str[i+1][j] == str[i][j]) j++;
		if(j < l1) {
			v[str[i][j]-'a'].push_back(str[i+1][j]-'a');
			in[str[i+1][j]-'a']++;
		}
		else if(j == l2 && j < l1) {
			round=1;
			break;
		}
	}
	round=0;
	for(i=0;i<26;i++) {
		if(round) break;
		memset(vis,0,sizeof(vis));
		dfs(i);
	}
	if(round) cout<<"Impossible"<<endl;
	else {
		j=0;
		while (1)
		{
			int f=0;
			for(i=0;i<26;i++) {
				if(in[i] == 0) {
					f=1;
					temp[j].push_back(i);
					in[i]--;
				}
			}
			for(k=0;k<temp[j].size();k++) {
				for(int t=0;t<v[temp[j][k]].size();t++) in[v[temp[j][k]][t]]--;
			}
			j++;
			if(!f) break;
		}
		for(i=0;i<j;i++) {
			for(k=0;k<temp[i].size();k++) printf("%c",temp[i][k]+'a');
		}
		printf("\n");
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
//#include <fstream>
#include <algorithm>

using namespace std;

int a[26][26];
int above[26];
int n;
char word1[110], word2[110];
char *cur, *pre;
char answer[27];

int main() {
	//ifstream cin("in.txt");
	//ofstream cout("out.txt");
	pre = word1;
	cur = word2;
	cin >> n;
	for (int i = 0; i < 26; i++){
		above[i] = 0;
		for (int j = 0; j < 26; j++)
			a[i][j] = 0;
	}
	cin >> pre;
	for (int i = 1; i < n; i++){
		cin >> cur;
		for (int j = 0; j < min(strlen(cur), strlen(pre)); j++) {
			if (pre[j] != cur[j]) {
				if (a[pre[j] - 'a'][cur[j] - 'a'] == 0) {
					a[pre[j] - 'a'][cur[j] - 'a'] = 1;
					above[cur[j] - 'a']++;

					break;
				}
			}
		}

		char *t = pre;
		pre = cur;
		cur = t;
	}

	for (int i = 0; i < 26; i++) {
		bool good = false;
		for (int j = 0; j < 26; j++){
			if (above[j] == 0) {
				good = true;
				answer[i] = 'a' + j;
				above[j] = 1000;
				for (int k = 0; k < 26; k++) {
					if (a[j][k] == 1) {
						above[k]--;
					}
				}
				break;
			}
		}
		if (!good) {
			cout << "Impossible";
			return 0;
		}
	}
	answer[26] = '\0';
	cout << answer;
	return 0;
}


#include <stdio.h>
#include <iostream>
//#include <fstream>
#include <algorithm>

using namespace std;

int a[26][26];
int above[26];
int n;
char word1[110], word2[110];
char *cur, *pre;
char answer[27];

int main() {
	//ifstream cin("in.txt");
	//ofstream cout("out.txt");
	pre = word1;
	cur = word2;
	cin >> n;
	for (int i = 0; i < 26; i++){
		above[i] = 0;
		for (int j = 0; j < 26; j++)
			a[i][j] = 0;
	}
	cin >> pre;
	for (int i = 1; i < n; i++){
		cin >> cur;
		bool diff = false;
		for (int j = 0; j < min(strlen(cur), strlen(pre)); j++) {
			if (pre[j] != cur[j]) {
				diff = true;
				if (a[pre[j] - 'a'][cur[j] - 'a'] == 0) {
					a[pre[j] - 'a'][cur[j] - 'a'] = 1;
					above[cur[j] - 'a']++;
				}
				break;
			}
		}
		if ((!diff) && (strlen(pre) > strlen(cur))) {
			cout << "Impossible";
			return 0;
		}

		char *t = pre;
		pre = cur;
		cur = t;
	}

	for (int i = 0; i < 26; i++) {
		bool good = false;
		for (int j = 0; j < 26; j++){
			if (above[j] == 0) {
				good = true;
				answer[i] = 'a' + j;
				above[j] = 1000;
				for (int k = 0; k < 26; k++) {
					if (a[j][k] == 1) {
						above[k]--;
					}
				}
				break;
			}
		}
		if (!good) {
			cout << "Impossible";
			return 0;
		}
	}
	answer[26] = '\0';
	cout << answer;
	return 0;
}