#include using namespace std; int main() { int N; string S, T; cin >> S >> T >> N; T = "_" + T; for (int i = 0; i < N; i++) S += T; cout << S << endl; }