#include <bits/stdc++.h>
using namespace std;
int n;
int minL = 11, maxL = 0;
char s[15], sym;
bool used[11000];
struct Node {
  string name;
  int id;
  Node(char *a, int b) {
    name = a;
    id = b;
  }
};
vector<Node> len[12], add;
vector<Node>::iterator itt[12];
bool cmp(Node a, Node b) { return a.name < b.name; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    used[i] = false;
    scanf("%s", s);
    minL = min(minL, (int)strlen(s));
    maxL = max(maxL, (int)strlen(s));
    len[strlen(s)].push_back(Node(s, i));
  }
  cin >> sym;
  for (int i = 0; i < 12; i++) {
    sort(len[i].begin(), len[i].end(), cmp);
    itt[i] = len[i].begin();
    for (vector<Node>::iterator it = len[i].begin(); it != len[i].end(); it++) {
      add.push_back(*it);
      add.rbegin()->name += sym;
    }
  }
  sort(add.begin(), add.end(), cmp);
  for (vector<Node>::iterator it = add.begin(); it != add.end(); it++) {
    if (used[it->id] == true) continue;
    cout << it->name;
    used[it->id] = true;
    int wanL = minL + maxL - it->name.size() + 1;
    while (used[itt[wanL]->id] == true) {
      itt[wanL]++;
    }
    cout << itt[wanL]->name << endl;
    used[itt[wanL]->id] = true;
  }
  return 0;
}
