#include <bits/stdc++.h>
using namespace std;
const long long INF = LONG_LONG_MAX, N = 1e5 + 2, MOD = 1e9 + 7;
long long binpow(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
long long NOD(long long NOD1, long long NOD2) {
  while (NOD2) {
    NOD1 %= NOD2;
    swap(NOD1, NOD2);
  }
  return NOD1;
}
long long NOK(long long NOK1, long long NOK2) {
  return NOK1 * NOK2 / NOD(NOK1, NOK2);
}
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int n, id;
string s;
map<int, pair<int, vector<string> > > mp, check;
vector<string> ans;
char d;
int main() {
  faster();
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    mp[s.size()].first++;
    mp[s.size()].second.push_back(s);
  }
  cin >> d;
  for (int i = 2; i <= 20; i++) {
    check = mp;
    for (auto it : check)
      if (i - it.first == it.first)
        if (it.second.first % 2 == 0)
          check[it.first].first = 0;
        else
          break;
      else
        check[i - it.first].first -= it.second.first, check[it.first].first = 0;
    bool ok = 1;
    for (auto it : check)
      if (it.second.first != 0) ok = 0;
    if (ok) {
      id = i;
      break;
    }
  }
  for (auto it : mp)
    sort(mp[it.first].second.begin(), mp[it.first].second.end()),
        mp[it.first].first = 0;
  for (auto it : mp) {
    while (mp[it.first].first != mp[it.first].second.size()) {
      string x, y;
      x = mp[it.first].second[mp[it.first].first];
      mp[it.first].first++;
      y = mp[id - it.first].second[mp[id - it.first].first];
      mp[id - it.first].first++;
      string a, b;
      a = x;
      a += d;
      a += y;
      b = y;
      b += d;
      b += x;
      if (a > b)
        ans.push_back(b);
      else
        ans.push_back(a);
    }
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
}
