#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int n, fixxed = 0;
vector<string> dict;
char d;
bool comp(string x1, string x2) {
  if (x1.length() != x2.length()) {
    for (int i = 0; i < (int)(min(x1.length(), x2.length())); i++)
      if (x1[i] < x2[i])
        return true;
      else if (x1[i] > x2[i])
        return false;
      else if (x1[i] == x2[i] && i == min(x1.length(), x2.length()) - 1)
        return (x1.length() > x2.length());
  } else
    return (x1 < x2);
}
int main() {
  cin >> n;
  dict.resize(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> dict[i];
    fixxed += dict[i].length();
  }
  fixxed /= n / 2;
  cin >> d;
  if (d <= 'z')
    sort(dict.begin(), dict.end());
  else
    sort(dict.begin(), dict.end(), comp);
  for (int i = 0; i < n / 2; i++) {
    cout << dict[i] << d;
    for (int j = i + 1; j < dict.size(); j++)
      if (dict[i].length() + dict[j].length() == fixxed) {
        cout << dict[j] << endl;
        dict.erase(dict.begin() + j);
        break;
      }
  }
  return 0;
}
