#include using namespace std; int main () { int N; cin >> N; string s, t; cin >> s >> t; while (N--) { int a; cin >> a; std::vector ans; while (a % s.size()) { a -= t.size(); ans.push_back(t); } while (a) { a -= s.size(); ans.push_back(s); } for (int i = 0; i < ans.size(); i ++) { cout << (i ? " " : "") << ans[i]; } cout << endl; } }