#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long INF64 = 1000LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL;
int n;
string c;
string s[100500];
string s2[100500];
void Load() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) cin >> s[i];
  cin >> c;
}
vector<pair<string, int> > ans;
set<string> st[22];
map<string, bool> mp;
inline bool tmp(const string &a, const string &b) {
  return a.size() < b.size() || (a.size() == b.size() && a < b);
}
inline bool tmp2(const string &a, const string &b) {
  return a.size() > b.size() || (a.size() == b.size() && a < b);
}
void Solve() {
  string x;
  int sum = 0;
  for (int i = 0; i < n; i++) sum += (int)s[i].size();
  sum = sum * 2 / n;
  for (int i = 0; i < n; i++) s2[i] = s[i] + c;
  sort(s2, s2 + n);
  sort(s, s + n);
  for (int i = 0; i < n; i++) st[sum + 1 - (int)s[i].size()].insert(s[i]);
  for (int i = 0; i < n; i++)
    if (mp[s2[i]] == false) {
      st[sum + 2 - (int)s2[i].size()].erase(
          s2[i].substr(0, (int)s2[i].size() - 1));
      cout << s2[i] + (*st[(int)s2[i].size()].begin()) << "\n";
      mp[(*st[(int)s2[i].size()].begin()) + c] = true;
      st[(int)s2[i].size()].erase(st[(int)s2[i].size()].begin());
    }
}
int main() {
  Load();
  Solve();
  return 0;
}
