for each(c in(r=readline)(e=r()))for(j in e)print(['('+e[j]+c+e[k]+')'for(k in e)].join(''))