#include <bits/stdc++.h>
const int MAXN = 1e4 + 10;
int n, dp[MAXN], m;
char w[100000 + 10][1000 + 10], s[MAXN];
struct Trie {
  int index;
  struct Trie* next[26];
  Trie() {
    index = 0;
    for (int i = 0; i < 26; ++i) next[i] = NULL;
  }
} * root;
void TrieInsert(int index) {
  Trie* u = root;
  for (int i = 0, t; w[index][i]; ++i) {
    t = tolower(w[index][i]) - 'a';
    if (!u->next[t]) u->next[t] = new Trie();
    u = u->next[t];
  }
  u->index = index;
}
void print(int x) {
  if (x == 0) return;
  print(x - strlen(w[dp[x]]));
  printf("%s ", w[dp[x]]);
}
int main() {
  root = new Trie();
  scanf("%d%s%d", &n, s, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%s", w[i]);
    TrieInsert(i);
  }
  memset(dp, -1, sizeof dp);
  dp[0] = 0;
  for (int len = 1; len <= n; ++len) {
    Trie* u = root;
    for (int j = len - 1, t; j >= 0; --j) {
      t = tolower(s[j]) - 'a';
      if (u->next[t])
        u = u->next[t];
      else
        break;
      if (u->index && ~dp[len - strlen(w[u->index])]) {
        dp[len] = u->index;
      }
    }
  }
  print(n);
}
