#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define SIZE 26
#define NUM 27


struct Edge{
	Edge(int arg_to,int arg_capacity,int arg_rev_index){
		to = arg_to;
		capacity = arg_capacity;
		rev_index = arg_rev_index;
	}
	int to,capacity,rev_index;
};

int V,E;

int num_start[SIZE],num_end[SIZE],table[SIZE][SIZE];
int index_table[SIZE];
int dist[NUM];
int cheked_index[NUM];
char words[10005][105];
vector<Edge> G[NUM];

void add_edge(int from,int to,int capacity){
	G[from].push_back(Edge(to,capacity,G[to].size()));
	G[to].push_back(Edge(from,0,G[from].size()-1));
}

void bfs(int source){
	for(int i = 0; i < V; i++)dist[i] = -1;
	queue<int> Q;
	dist[source] = 0;
	Q.push(source);

	while(!Q.empty()){
		int node_id = Q.front();
		Q.pop();
		for(int i = 0; i < G[node_id].size(); i++){
			Edge &e = G[node_id][i];
			if(e.capacity > 0 && dist[e.to] < 0){
				dist[e.to] = dist[node_id]+1;
				Q.push(e.to);
			}
		}
	}
}

int dfs(int node_id,int sink,int flow){
	if(node_id == sink)return flow;

	for(int &i = cheked_index[node_id]; i < G[node_id].size(); i++){
		Edge &e = G[node_id][i];
		if(e.capacity > 0 && dist[node_id] < dist[e.to]){
			int tmp_flow = dfs(e.to,sink,min(flow,e.capacity));
			if(tmp_flow > 0){
				e.capacity -= tmp_flow;
				G[e.to][e.rev_index].capacity += tmp_flow;
				return tmp_flow;
			}
		}
	}
	return 0;
}


int max_flow(int source,int sink){
	int flow = 0,add;
	while(true){
		bfs(source);
		if(dist[sink] < 0)break;
		for(int i = 0; i < V; i++)cheked_index[i] = 0;
		while((add = dfs(source,sink,BIG_NUM)) > 0){
			flow += add;
		}
	}
	return flow;
}


int main(){

	int N;
	scanf("%d",&N);

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

		num_start[i] = 0;
		num_end[i] = 0;

		for(int k = 0; k < SIZE; k++){

			table[i][k] = 0;
		}
	}

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

		scanf("%s",words[i]);

		char first_ch = words[i][0];
		char last_ch = first_ch;

		for(int k = 0; words[i][k] != '\0'; k++){

			last_ch = words[i][k];
		}

		if(last_ch != first_ch){

			num_start[first_ch-'a']++;
		}
		num_end[last_ch-'a']++;

		table[first_ch-'a'][last_ch-'a']++;
	}

	V = 27;
	int index;
	int source = 25,sink = 26;

	for(int i = 0; i < 26; i++){
		if(num_end[i] == 0)continue;

		index = 0;
		for(int k = 0; k < SIZE; k++){
			if(k == i)continue;
			index_table[k] = index++;
		}

		if(num_start[i] == 0){
			printf("%c\n",'a'+i);
			continue;
		}

		for(int k = 0; k < NUM; k++){

			G[k].clear();
		}

		//sourceからエッジを張る
		for(int k = 0; k < SIZE; k++){
			if(table[i][k] == 0 || k == i)continue;

			add_edge(source,index_table[k],table[i][k]);
		}

		for(int a = 0; a < SIZE; a++){
			if(a == i || num_start[a] == 0)continue;
			for(int b = 0; b < SIZE; b++){
				if(b == i || table[a][b] == 0)continue;

				add_edge(index_table[a],index_table[b],table[a][b]);
			}
		}

		//sinkへエッジを張る
		for(int k = 0; k < SIZE; k++){
			if(table[k][i] == 0 || k == i)continue;

			add_edge(index_table[k],sink,table[k][i]);
		}

		if(max_flow(source,sink) == num_start[i]){

			printf("%c\n",'a'+i);
		}
	}

	return 0;
}



Measured memory_bytes: 4284