#include <bits/stdc++.h>
#define inf 2000000000
using namespace std;
// 0-indexed
struct Dinic {
  struct edge {
    int to;
    int cap;
    int rev;
  };
  vector<vector<edge>> lst;
  vector<int> completed;
  vector<int> dist;
  Dinic(int n = 1) {
    // if 1-indexed
    //++n;
    lst.resize(n);
    completed.resize(n);
    dist.resize(n);
  }
  bool add(int start, int goal, int capacity) {
    lst[start].push_back(
        (edge){goal, capacity, (int)lst[goal].size()});
    lst[goal].push_back(
        (edge){start, 0, (int)lst[start].size() - 1});
    return 1;
  }
  // dist = time from start to now number
  void distbfs(int start) {
    fill(dist.begin(), dist.end(), -1);
    queue<int> bfsqu;
    dist[start] = 0;
    bfsqu.push(start);
    while(bfsqu.size() > 0) {
      int now = bfsqu.front();
      bfsqu.pop();
      for(int i = 0; i < lst[now].size(); ++i) {
        edge* nowe = &lst[now][i];
        if(nowe->cap > 0 && dist[nowe->to] < 0) {
          dist[nowe->to] = dist[now] + 1;
          bfsqu.push(nowe->to);
        }
      }
    }
  }
  int pathdfs(int now, int goal, int nf) {
    if(now == goal) return nf;
    for(int& i = completed[now]; i < lst[now].size(); ++i) {
      edge* e = &lst[now][i];
      if(e->cap > 0 && dist[now] < dist[e->to]) {
        int ans = pathdfs(e->to, goal, min(nf, e->cap));
        if(ans > 0) {
          e->cap -= ans;
          lst[e->to][e->rev].cap += ans;
          return ans;
        }
      }
    }
    return 0;
  }
  int solve(int start, int goal) {
    int ans = 0, nf = 0;
    while(1) {
      // bfs
      distbfs(start);
      // cannnot go to goal from start
      if(dist[goal] < 0) return ans;
      // reset
      fill(completed.begin(), completed.end(), 0);
      while((nf = pathdfs(start, goal, inf)) > 0) ans += nf;
    }
    return -1;
  }
};

int cnt[26] = {0};
int memo[26][26] = {0};
bool ch[26] = {0};
int n;
Dinic dn;

void solve();

int main() {
  cin >> n;
  dn = Dinic(52);
  for(int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    ch[s[s.size() - 1] - 'a'] = 1;
    ++cnt[s[0] - 'a'];
    ++memo[s[0] - 'a'][s[s.size() - 1] - 'a'];
  }
  for(int i = 0; i < 26; ++i)
    for(int j = 0; j < 26; ++j) {
      if(i == j) dn.add(i + 26, j, 1000000);
      if(memo[i][j] != 0) dn.add(i, j + 26, memo[i][j]);
    }

  solve();
  return 0;
}

void solve() {
  for(int i = 0; i < 26; ++i) {
    if(ch[i] && cnt[i] == dn.solve(i, i + 26))
      cout << (char)(i + 'a') << endl;
  }
}
