#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  solve();
  return 0;
}
char input[10000][11];
int l[10000];
char d[2];
int N;
vector<int> gr[11];
struct Cmp {
  bool operator()(int a, int b) const { return strcmp(input[a], input[b]) < 0; }
};
struct Cmp2 {
  bool operator()(const string& a, const string& b) const {
    return a + d + b < b + d + a;
  }
};
struct Cmp3 {
  bool operator()(const string& a, const string& b) const {
    return a + b < b + a;
  }
};
void solve() {
  scanf("%d", &N);
  int len = 0;
  for (int i = 0; i < N; i++) {
    scanf("%s", input[i]);
    l[i] = strlen(input[i]);
    len += l[i];
    gr[l[i]].push_back(i);
  }
  for (int i = 1; i <= 10; i++) sort(gr[i].begin(), gr[i].end(), Cmp());
  scanf("%s", d);
  vector<string> ans;
  int x = 2 * len / N;
  for (int l1 = 1; l1 <= x - l1; l1++) {
    int l2 = x - l1;
    if (l1 < l2) {
      for (int i = 0; i < (int)((gr[l1]).size()); i++) {
        string s1 = string(input[gr[l1][i]]) + d + input[gr[l2][i]];
        string s2 = string(input[gr[l2][i]]) + d + input[gr[l1][i]];
        if (s1 < s2)
          ans.push_back(s1);
        else
          ans.push_back(s2);
      }
    } else {
      vector<string> v;
      for (int i = 0; i < (int)((gr[l1]).size()); i++) {
        v.push_back(input[gr[l1][i]]);
      }
      sort(v.begin(), v.end(), Cmp2());
      for (int i = 0; i < (int)((v).size()); i += 2) {
        ans.push_back(v[i] + d + v[i + 1]);
      }
    }
  }
  sort(ans.begin(), ans.end(), Cmp3());
  for (int i = 0; i < (int)((ans).size()); i++) {
    puts(ans[i].c_str());
  }
}
