#include <bits/stdc++.h>
using namespace std;
struct node {
  node *next[26];
  int leaf;
  node() {
    memset(next, 0, sizeof next);
    leaf = -1;
  }
};
node *root;
void insert(char *x, int pos) {
  int len = strlen(x);
  node *cur = root;
  for (int e = 0; e < len; e++) {
    int id = tolower(x[len - e - 1]) - 'a';
    if (!cur->next[id]) cur->next[id] = new node();
    cur = cur->next[id];
  }
  cur->leaf = pos;
}
char text[10100], aux[10100];
string alp[10100 * 10];
map<long long, int> hashs;
vector<int> ans;
int n;
int solve(int ind) {
  if (ind == n) return 1;
  node *cur = root;
  for (int e = ind; e < n; e++) {
    int id = text[e] - 'a';
    if (!cur->next[id]) break;
    cur = cur->next[id];
    if (cur->leaf != -1)
      if (solve(e + 1)) {
        ans.push_back(cur->leaf);
        return 1;
      }
  }
  return 0;
}
int main() {
  root = new node();
  scanf("%d %s", &n, text);
  int m;
  scanf("%d", &m);
  for (int e = 0; e < m; e++) {
    scanf("%s", aux);
    for (int f = 0; aux[f]; f++) alp[e].push_back(aux[f]);
    insert(aux, e);
  }
  solve(0);
  reverse(ans.begin(), ans.end());
  for (auto it : ans) printf("%s ", alp[it].c_str());
  return 0;
}
