#include <bits/stdc++.h>
using namespace std;
char s[10005], haha[100005][1005];
int n, m, nd, trie[1000005][26], mrk[1000005], len[100005], sta[10005], top;
void insert(int x) {
  int p = 0;
  for (int i = len[x] - 1; i >= 0; i--) {
    char tmp = haha[x][i];
    if (tmp >= 'A' && tmp <= 'Z') tmp = tmp - 'A' + 'a';
    if (!trie[p][tmp - 'a']) trie[p][tmp - 'a'] = ++nd;
    p = trie[p][tmp - 'a'];
  }
  mrk[p] = x + 1;
}
void dfs(int dep) {
  if (dep == n) {
    for (int i = 1; i <= top; i++) {
      printf("%s", haha[sta[i]]);
      printf(i == top ? "\n" : " ");
    }
    exit(0);
  }
  int p = 0;
  for (int i = dep; i < n; i++) {
    if (!trie[p][s[i] - 'a']) break;
    p = trie[p][s[i] - 'a'];
    if (mrk[p]) {
      sta[++top] = mrk[p] - 1, dfs(dep + len[mrk[p] - 1]);
      top--;
    }
  }
}
int main() {
  scanf("%d%s", &n, s);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%s", haha[i]);
    len[i] = strlen(haha[i]);
    insert(i);
  }
  dfs(0);
  return 0;
}
