char*a,*b,*c,e[9],m[9];main(){gets(e);gets(m);for(a=m;*a;a++)for(b=e;*b;puts(""),b++)for(c=e;*c;c++) printf("(%c%c%c)",*b,*a,*c);}