#include <bits/stdc++.h>
using namespace std;
bool myless(const string &a, const string &b) { return (a + b < b + a); }
vector<string> a[11], all;
string s, s1, s2;
int n, l = 0, r = 10, cur[11];
char d;
int main() {
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    getline(cin, s);
    a[s.length()].push_back(s);
  }
  for (int i = 1; i <= 10; i++) sort(a[i].begin(), a[i].end());
  scanf("%c", &d);
  while (a[l].size() == 0) l++;
  while (a[r].size() == 0) r--;
  while (l <= r) {
    if (cur[r] == a[r].size()) {
      l++;
      r--;
      continue;
    }
    s1 = a[l][cur[l]];
    cur[l]++;
    s2 = a[r][cur[r]];
    cur[r]++;
    if (s1 + d + s2 < s2 + d + s1)
      all.push_back(s1 + d + s2);
    else
      all.push_back(s2 + d + s1);
  }
  sort(all.begin(), all.end(), myless);
  for (int i = 0; i < all.size(); i++) cout << all[i] << endl;
  return 0;
}
