#include <bits/stdc++.h>
using namespace std;
struct node {
  string val;
  shared_ptr<node> next[26];
};
auto head = make_shared<node>();
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  string s, t;
  cin >> n >> s;
  reverse(s.begin(), s.end());
  s = " " + s;
  long long m;
  cin >> m;
  while (m--) {
    cin >> t;
    shared_ptr<node> curr = head;
    for (auto &i : t) {
      char ch = tolower(i);
      if (!curr->next[ch - 'a']) {
        curr->next[ch - 'a'] = make_shared<node>();
      }
      curr = curr->next[ch - 'a'];
    }
    curr->val = t;
  }
  vector<long long> dp(n + 1, -1);
  vector<shared_ptr<node> > strno(n + 1);
  dp[0] = 0;
  for (long long i = 1; i <= n; i++) {
    if (dp[i - 1] == -1) continue;
    long long val1 = 0, val2 = 0;
    shared_ptr<node> curr = head;
    for (long long j = i; j <= n; j++) {
      if (!curr->next[s[j] - 'a']) {
        break;
      }
      curr = curr->next[s[j] - 'a'];
      if (curr->val.size()) {
        dp[j] = i - 1;
        strno[j] = curr;
      }
    }
  }
  long long curr = n;
  while (curr) {
    assert(strno[curr] != nullptr);
    assert(curr != -1);
    cout << strno[curr]->val << " ";
    curr = dp[curr];
  }
  return 0;
}
