#include <iostream>
#include <string>
using namespace std;

int main()
{
    string str1,c1,c2;
    int n1,n2;
    str1=c1+c2;
    getline(cin,c1);
    getline(cin,c2);
    cin>>n1>>n2;
    if(n1==n2)
    {
        str1=c1+c2;
       while(n1-1>0)
       {
           str1=str1+c1+c2;
           n1--;
       }
    }
    cout<<str1;
}