#include <bits/stdc++.h>
int N, M, T[1000002][26], end[1000002], n = 1, f[10001], g[10001];
std::string s[100001];
char a[10002];
int main() {
  scanf("%d%s%d", &N, a + 1, &M);
  for (int i = 1; i <= M; i++) {
    std::cin >> s[i];
    int p = 1;
    for (char __e : s[i]) {
      int let = 'a' <= __e && __e <= 'z' ? __e - 'a' : __e - 'A';
      if (!T[p][let]) T[p][let] = ++n;
      p = T[p][let];
    }
    end[p] = i;
  }
  f[0] = 1;
  for (int i = 1; i <= N; i++) {
    int p = 1;
    for (int j = i; j; j--) {
      p = T[p][a[j] - 'a'];
      if (end[p] && f[j - 1]) {
        f[i] = end[p];
        g[i] = j - 1;
      }
    }
  }
  assert(f[N]);
  std::vector<int> V;
  for (int i = N; i; i = g[i]) V.push_back(f[i]);
  std::reverse(V.begin(), V.end());
  for (int i : V) std::cout << s[i] << ' ';
  std::cout << std::endl;
  return 0;
}
