SPOJ 15558: Let us play with strings