Buy the String

Problem Name:
Buy the String
Site:CodeForces
Links:
Tags:
Problem setters: