2004' ACM/ICPCѵϰ 11

D: Power Strings