#include <bits/stdc++.h>
using namespace std;
string s[10100];
bool compare(string s1, string s2) {
  return s1.length() < s2.length() || s1.length() == s2.length() && s1 < s2;
}
string concat(string s1, string s2, char c) {
  int a = s1.length(), b = s2.length();
  int l = min(a, b);
  for (int i = 0; i < l; i++) {
    if (s1[i] < s2[i])
      return s1 + c + s2;
    else if (s1[i] > s2[i])
      return s2 + c + s1;
  }
  if (c > 'z') {
    if (a < b)
      return s2 + c + s1;
    else
      return s1 + c + s2;
  } else {
    if (a < b)
      return s1 + c + s2;
    else
      return s2 + c + s1;
  }
}
int main() {
  int n, x, y, z;
  char c;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  cin >> c;
  sort(s, s + n, compare);
  x = 0, y = n - 1;
  while (x < y) {
    z = 0;
    if (s[x].length() == s[y].length()) {
      for (int i = 0; x + 2 * i < y; i++)
        s[x + i] = concat(s[x + 2 * i], s[x + 2 * i + 1], c);
      break;
    }
    while (s[y].length() == s[y - 1].length()) y--, z++;
    for (int i = 0; i <= z; i++) s[x + i] = concat(s[x + i], s[y + i], c);
    x += z + 1, y--;
  }
  sort(s, s + n / 2);
  for (int i = 0; i < n / 2; i++) cout << s[i] << endl;
}
