#!/usr/bin/perl -lp
$_=(join"(",split//).")"x(y///c-1)