#include using namespace std; int main(){ int N; cin >> N; string S, T; cin >> S >> T; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } for (int i = 0; i < N; i++){ int k = 0; while ((A[i] - k) % S.size() != 0){ cout << T << ' '; k += T.size(); } while (k < A[i]){ cout << S << ' '; k += S.size(); } cout << endl; } }