#include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

class MaxFlow {
public:
  struct edge { ll to, cap, rev; };

  const ll INF = 1LL << 60;
  ll N;
  vector< vector<edge> > E;
  vector<bool> used;

  MaxFlow(ll n): N(n), E(n), used(n) {};

  void add_directed_edge(ll from, ll to, ll cap) {
    E[from].push_back((edge) { to, cap, (ll) E[to].size() });
    E[to].push_back((edge) { from, 0, (ll) E[from].size() - 1 });
  }

  ll dfs(ll v, ll t, ll f) {
    if(v == t) return f;
    used[v] = true;
    REP(i, 0, E[v].size()) {
      edge &e = E[v][i];
      if(!used[e.to] && e.cap > 0) {
        ll d = dfs(e.to, t, min(f, e.cap));
        if(d > 0) {
          e.cap -= d;
          E[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }

  ll max_flow(ll s, ll t) {
    ll flow = 0;
    while(1) {
      REP(i, 0, N) used[i] = false;
      ll f = dfs(s, t, INF);
      if(f == 0 || f == INF) break;
      flow += f;
    }
    return flow;
  }
};

int main(void) {
  ll N;
  cin >> N;
  vector<string> S(N);
  REP(i, 0, N) cin >> S[i];

  vector<bool> last(256, false);
  REP(i, 0, N) last[S[i].back()] = true;

  for (char c = 'a'; c <= 'z'; c++) if (last[c]) {
    MaxFlow mf(28);
    ll s = 26, t = 27;
    ll cnt = 0;
    REP(i, 0, N) {
      char f = S[i].front(), b = S[i].back();
      ll u = f == c ? s : f - 'a';
      ll v = b == c ? t : b - 'a';
      mf.add_directed_edge(u, v, 1);
      if (u == s) cnt++;
    }
    ll flow = mf.max_flow(s, t);
    if (cnt == flow) cout << c << endl;
  }
}
